Archive: All auto-uninstallers are buggy... No solution, Better work around?


All auto-uninstallers are buggy... No solution, Better work around?
I've researched this issue all through the forums here and at the archives. I've tried everything I've found to help uninstall a previously installed application (same directory) but fail everytime in one way or another...

Most likely I would blame myself. I have a snapshot build about less than a week old from this posting. I've checked the following links and ran all examples in partial success.

http://nsis.sourceforge.net/site/ind...&tx_faq_faq=14
http://nsis.sourceforge.net/archive/...php?pageid=326
http://forums.winamp.com/showthread....ight=uninstall
http://forums.winamp.com/showthread....ight=uninstall
http://forums.winamp.com/showthread....ight=uninstall
http://forums.winamp.com/showthread....ight=uninstall

The above is about all I've been through and all solutions I've managed to gather from these postings all had one problem in common with my installer. It would managed to remove the registry entries but 100% of the time it would not fully uninstall the files and directories the uninstaller usually always remove...

The good old ExecWait '"$INSTDIR\uninstall.exe" _?=$INSTDIR' might or might not be the culprit but its basically found in all examples. In my situation it never removes everything but itself. There will always be directories left behind and within them a plethora of files. I've noticed though if I ran the installer twice it would usually get rid of them the second time around, if not the third time for sure.

Being this was the case and considering I've got my latest snapshot from the official NSIS archive I thought then how about looping it? But I could not manage to loop it without going through the "are you sure you wish to uninstall" for every loop... Yeah, I tried the silent uninstall option by calling the "/S" but I guess my build didn't have it enabled... I could never get it to silently uninstall...

Ultimately I've managed to create a real simple solution but something about it is bothering me. This solution is childs play and I am sure but it does better than anything I've managed to come across so far... Here it is...

CopyFiles "$INSTDIR\uninstall.exe" "C:\uninstall.exe"
ExecWait '"C:\uninstall.exe" _?=$INSTDIR\'
Delete "C:\uninstall.exe"


The above snippet removes all of the applications associated extensions, registry entries and removes the entire applications directory... Perfect but a new problem stems from this... Forgive me but I am quite anal if any program leaves behind even the tiniest, simplest and most harmless registry entry or value... I believe if the installer installs it, the uninstaller should uninstall it...

One new registry value is created but for the life of me I cannot delete it through the new applications installer... I am sure if not absolute it can be done but I am not knowledgeable enough to do it at the moment... I need help.

The value left behind is created from the old uninstaller on the c:\ drive... I do not know how to record it's creation or how to simply delete it... The following is more information in regards to the value...

KEY INFORMATION:
Computer: Local
Hive: HKEY_USERS
Key: S-1-5-21-971929597-1256799619-874574627-1005
\Software\Microsoft\Windows\ShellNoRoam\MUICache

Full Path: HKEY_USERS\S-1-5-21-971929597-1256799619-874574627-1005
\Software\Microsoft\Windows\ShellNoRoam\MUICache

Number of Sub Keys: 0
Number of Values: 327
Last Modified: Sunday, October 12, 2003 3:09:57 PM

VALUE INFORMATION:
Value: C:\uninstall.exe
Type: REG_SZ (String)

DATA INFORMATION:
Data: uninstall


I am on Windows XP and would appreciate a solution which will work on all NT systems. 95/98/ME are obsolete. NT/2000/XP/2003 is the target.

Can someone help me pinpoint uninstalling the new registry value?

Thank you for your time on this issue. It is greatly appreciated.

Are you sure you are using the right folder for the Delete commands?

Example:

Delete "$INSTDIR\app.exe"


MUICache
this is just windows keeping track of things that have been used recently its not going to hurt it to be there in fact it sould be over ridden later


I've examined my C:\ drive for any uninstallers which might help to conflict with my applications progress. I didn't find any and so I only really ran my above example as a test. To be a little safer in regards to launching another uninstaller, I've began to use the following example...

Function .onInit
CopyFiles "$INSTDIR\uninstall.exe" "$TEMP\uninstall-NAMEOFPRODUCT.exe"
ExecWait '"$TEMP\uninstall-NAMEOFPRODUCT.exe" _?=$INSTDIR\'
Delete "$TEMP\uninstall-NAMEOFPRODUCT.exe"
FunctionEnd


The above snippet works just as good as the original, everything ever installed is uninstalled and the new installer waits for the previous application to finish uninstalling.

Joost, I believe I got the delete line correct. The uninstaller does it's job and is deleted in the end. ZmAn3 , I understand the MUICache value created but would really like to delete it through the new installer...

Ultimately I'll move ahead as this auto-uninstall code I've created works best for me. Thank you guys a bundle for your time and help :)

You are definately doing something wrong. This weird code will probably give problems too.

* $INSTDIR is the uninstaller is set to $EXEDIR. If you want to execute the installer in another folder, you should get $INSTDIR from the registry or a settings file

* Always use a folder when using commands like Delete

* The current folder does not make any difference when changing registry values

Still have problems? Please attach the entire script.