Retain Registry Value on Uninstall - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

tna55
Posts: 1
Joined: Thu Aug 16, 2007 5:35 pm

Retain Registry Value on Uninstall

Hi,

I store a registry value when the software installs. When the newer version of software is installed I run a custom action (an EXE) to do database updates i.e. run some scripts. I have a check in the custom EXE that it should not run scripts for version that was already installed.

The trouble however is that during installation the older version is removed first (the registry is removed) and then the new files (including new scripts) are copied. This means that the custom EXE runs all the scripts because it does not find anything in the registry.

How can I retain the registry key on uninstall? Is there another way to do what I am doing? What are environment variables and can they help me here?

Many thanks

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

Hi,

Please give more details about the registry value! Do you use it only for conditioning the custom action or is it used by the program you install?

If the registry value is used only for conditioning the custom action, you can use the "NOT OLDPRODUCTS" condition in the "Expression" field ("Custom Action Properties" page, "Execution Condition" section). This way the custom action will run only on a clean install and not on an upgrade.

However, if you don't want a registry value to be removed on uninstall you can select "Permanent" and "Never Overwrite" flags in the "Organization" page for the component associated to the value.

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

Return to “Common Problems”