Archive: Uninstaller


Uninstaller
Is there any way to make a uninstaller generated by NSIS to return code 1 instead of 0 when uninstalling was successful?

The reason to do it is that after returning code 1 by the uninstaller, the Add/Remove List will be refreshed. But if code 0 was returned, the Add/Remove List will continue to show inside the product name, for which
the uninstaller was called.


try putting a RegEntry in
HKLM\Microsoft\windows\currentversion\uninstall
with "DisplayName" and "UnInstallString"

This entry will disappear if you delete these entries
at uninstall and also the add/remove list will be
updated.

- :D Hendri :D -


Having the uninstaller return 1 will actually not help these, because when executed the uninstaller copies itself to the system temporary directory, runs itself from that directory, and quits instantly. For this reason, the list is not properly refreshed. I'm not sure of a good workaround (maybe the uninstaller can signal the windows add/remove programs dialog to refresh?)...

-Justin


Smile2Me, I really remove these entries from the Registry during uninstalling, but the Add/Remove List will be updated only after closing its window and following opening.
I have done some tests and got to know that if an uninstaller return 1, the Add/Remove List will be refreshed immediately.


justin, I got it. It is really hard to make a good workaround.
By the way, I tried to send the broadcast WM_SETTINGCHANGE message with 0 as parameters after uninstalling, but there was no effect. I do not know another way to signal the Add/Remove List. :(


Came up with a crappy way that works for me, at least in winME (the strings/etc might differ on win95/NT/2k/98/etc). Here it is:

Function un.RefreshUninstallPanel
Push $0
Push $1
StrCpy $1 ""
again:
FindWindow $0 "#32770" "Add/Remove Programs Properties"
StrCmp $0 0 done
SendMessage $0 16 0 0
StrCpy $1 1
goto again
done:
StrCmp $1 "" noopen
Exec '"$WINDIR\control.exe" appwiz.cpl'
noopen:
Pop $1
Pop $0
FunctionEnd


I'll see if I can come up with something better...

-Justin

P.S. It might be the most elegant to call this from un.onUninstSuccess...


Well ok, I see your point now.
Actually I'm running Win2k and
I didn't have this problem, but
I tested it on another machine...

Indeed you're both right (of course).

Sorry for my remark,

- :D Smile2Me :D -