prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Unable to update registry via Modify

Mon May 31, 2021 2:10 pm

Hello,

In one of my projects I have a registry entry that is based on a property (key and value both).
Meaning, the entry is created based on the input provided by the user in one of the dialog.

Recently, I enabled "Modify" option for the installer and when I change the input in this stage, I am expecting the registry should also get updated.
But, that is not the case. The registry entry remains unchanged.

However, if I manually rename the registry and then run the installer again in "Modify" state, it successfully creates the new entry with the updated value. I have attached a sample project with the above mentioned behaviour.

Steps to reproduce:
  • Run the project and provide a value in the text input.
  • Upon completion, some registry entries will be created
  • In the control panel, click on "Update/Change" button
  • Select "Modify" in "MaintenanceTyleDlg"
  • Update the value (the old value if fetched via search + powershell custom action)
  • Check the registry again
Please do let me know if you need anymore information.

Thank you.
Prerak
Attachments
ModifyTest.aip
(30.29KiB)Downloaded 264 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Unable to update registry via Modify

Thu Jun 03, 2021 4:39 pm

Hello Prerak,

Please note that this is the default behavior of Windows Installer.

Since it does not detect any changes (no feature state changes), it will not update the registry.

The solution to this would be:

- create a new feature in "Organization" page

- take the component assigned to your registry entry and move it to newly created feature

- create a "Reinstall one or more features" event on your dialog with the argument being the feature identifier ("Organization" page --> your feature --> "Identifier" section)

This way, the registry should be updated during the "Modify".

Hope it helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Unable to update registry via Modify

Tue Jun 08, 2021 11:40 am

Hi Catalin,

Thank you for the help. It did the work.

Prerak

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Unable to update registry via Modify

Tue Jun 08, 2021 1:42 pm

You are always welcome, Prerak!

I am glad to hear everything works as expected.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”