werelord
Posts: 16
Joined: Thu Nov 05, 2009 3:47 pm

Registry key removal on uninstall

We're having problems with a Registry Key cleanup on uninstall.. We have a key and values that are created by our application; we tried to set up the Advanced Installer project to delete that key (and all values within) on uninstall, but that does not appear to be working..

I've attached a sample AI project (v8.3) to this message that shows the problem. On the Registry tab, we create our key; and go thru the "Uninstall Cleanup" wizard, setting "Remove registry key with all its sub-keys and values", and force removal without asking for permission.. For test purposes, I also added a default value inside that key to the string "foo". Inside the zip there is also a .reg file that simulates our application creating other values within that key..

To test, first build and install the MSI; should create the key and the default value in HKCU.. Merge the "testregdel.reg" file into the registry; will add the other values in that key.. Then uninstall the application; the uninstall will only remove the default value (set by AI) but not any of the other registry values that were merged..

Test environment was Windows 7 Professional (x86) SP1.. The Windows Installer logfile, on removing the regkey, gives a returncode value of "1" when removing the key; not sure what that means..

Are we setting something wrong, or is this a bug with AI, or even Windows Installer?? If it is a bug with AI, is there an older version that doesn't have this bug??
Attachments
testregdel.zip
(3.26 KiB) Downloaded 358 times
werelord
Posts: 16
Joined: Thu Nov 05, 2009 3:47 pm

Re: Registry key removal on uninstall

Fixed my own problem..

On the regkey tab, on the key in question, Properties -> Registry Key tab, the checkbox "Delete (if present) on uninstall)" was unchecked.. Checking that box removes the key and all contents..

Maybe should have the uninstall cleanup wizard check that box automatically..
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Registry key removal on uninstall

Hello,

This is unexpected behavior, thank you for reporting it. I have forwarded the issue to our QA and Development team and we will communicate the result of the investigation. We'll reply as soon as we have the chance to investigate and return with something conclusive.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 79
Joined: Thu Nov 18, 2010 5:02 pm

Re: Registry key removal on uninstall

I'm having the same issue.

I tried to resolve it by applying the same fix @werelord made but this causes the registry key to be removed when uninstall is done via upgrade (and even with the condition (AI_CLEAN_RESOURCES_UNINSTALL = "1") AND (NOT UPGRADINGPRODUCTCODE) in place).

My requirement is for the installer to delete the key ONLY when manually uninstalling. Automatic uninstall as part of an upgrade should keep the key.

How can I do this? What conditions to apply?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Registry key removal on uninstall

Hi,

If you want to preserve a registry value during an upgrade, here is an article you can follow.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 79
Joined: Thu Nov 18, 2010 5:02 pm

Re: Registry key removal on uninstall

I tried to follow this post here.
http://www.advancedinstaller.com/forums ... f=2&t=8703

But, somehow I still don't see my reg keys getting removed. What am I doing wrong?

I even placed MessageBox.Show inside the VBS just to see if they get called but no message box appears. Is there a simpler way to debug VBS in the installer?
Attachments
uninstall.log
(359.98 KiB) Downloaded 341 times
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Registry key removal on uninstall

Hi,

The log you attached is for a clean installation. There is no upgrade process. So the forum post you mentioned doesn't apply.

Can you please give me more details about what you need to do? Also, please send us the .AIP (project) file you are using to support at advancedinstaller dot com so we can take a look at it.

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

Return to “Common Problems”