ravi
Posts: 5
Joined: Fri Nov 09, 2007 4:26 pm

Registry -- Delete key on uninstall, & leave on overinst

My application uses the registry to store data in
HKEY_CURRENT_USER\Software\MyCompany\MyApp\

My application creates subkeys & values within the MyApp\ Registry key during application runtime.

I want Advanced Installer to delete the \MyApp registry key (including all subkeys & values) on uninstall. But want it to remain unchanged on upgrade-overinstall --

To do an upgrade, right now, I increase the Product Version number and generate a new Product Code. Also note that I am doing the above 2 things automatically via a script I have that edits the .aip file (-- my script reads the product version, increments it; creates a new guid, replaces the product code & saves the aip file.

Is there any way to acheive my desired result -- leave the key on upgrade, delete key on uninstall?
Right now my advanced installer project is always deleting the registry key on either uninstall or overinstall
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
I want Advanced Installer to delete the \MyApp registry key (including all subkeys & values) on uninstall. But want it to remain unchanged on upgrade-overinstall
Right now my advanced installer project is always deleting the registry key on either uninstall or overinstall
This can be done by using a custom action which removes the registry keys and runs only during the uninstall process (you can use the REMOVE="ALL" condition).

Note that you can condition your code that currently deletes the registry entries on uninstall. You can read more about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ravi
Posts: 5
Joined: Fri Nov 09, 2007 4:26 pm

I thought REMOVE="ALL" will run during the uninstall of both just-uninstall and version-upgrade?

Should the condition be
NOT (UPGRADINGPRODUCTCODE) AND REMOVE="ALL"
?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Note that I was referring to the case in which the registry entries are created by your application (like you mentioned in your first post), and not by the installation package.

When creating registry entries in the Windows Registry manually, through a custom action or by using your application, these entries will not be removed by the uninstall process because they are not registered in the MSI package.

However, if you create the registry entries by using the "Registry" page in Advanced Installer, then they will be removed automatically when uninstalling the MSI. In this case, the solution is to mark the components of the registry entries as "Permanent" and use a custom action to remove them.

Like you said, the custom action will have this condition:

Code: Select all

(REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE))
This way, the registry entries will be removed only during an uninstall which is not performed by an upgrade.

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

Return to “Common Problems”