king_kobra
Posts: 8
Joined: Tue Feb 20, 2007 12:06 am

Registry Value Never Overwrite

I have a registry value which can be changed by the user that I do not want to reset to the default value when the software is updated. The problem is I did not mark this value permanent and never overwrite. On the release that I am creating right now, I am OK with resetting the default value but dont want this behavior for future releases so I marked the value permanent and never overwrite. What happens is that the uninstaller removes the value and the installer does not write the default. I assume this is because MSI is checking before the uninstall for the existence of the value and at that point deciding not to write the value during install.

Is there any good way around this? I don't understand why the value is not written at installation time since the value does not exist.

Thank you very much.

Kobra
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Registry Value Never Overwrite

Hi,
I don't understand why the value is not written at installation time since the value does not exist.
This is a known bug in Windows Installer. When the upgraded package runs, it detects the registry value and sees it as installed, therefore, the upgraded package will not install it anymore. Since the value is removed by the uninstall of the old package, it will not be present on the machine when the upgrade is complete.

The solution is to backup and restore the registry entry through custom actions. There is another post on the forum which contains some sample custom actions, please take a look:
http://www.advancedinstaller.com/forums ... f=2&t=4853

Also, perhaps you will find this useful.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”