broadware
16th October 2006 20:11 UTC
Uninstall in onInit w/o reboot page
In the .onInit function I uninstall the previous version before installing the next via (http://nsis.sourceforge.net/Auto-uni...installing_new):
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
but a dialog appears with two radio buttons, one to reboot now (default), the other: Manually reboot later.
I would like to skip this page or have the default set to 'manullly reboot later.'
Removing _?=$INSTDIR suppress the reboot page, but then installer does not wait for the uninstaller to complete before executing.
kichik
16th October 2006 20:34 UTC
Copy the uninstaller to the temporary directory and execute it from there. If you don't, it won't be able to delete itself and its containing directory.
broadware
16th October 2006 21:23 UTC
Are you saying I should change the statement to:
ExecWait '$R0'
If I do that, the uninstaller executes in a window on top of the installer window, instead of the installer window waiting until the uninstaller window is finsihed before appearing.
The Reboot window has disappered, which is great, but I would like the uninstallation window to disapper before the installation window appears.
broadware
17th October 2006 00:57 UTC
This is what he means:
ExecWait '$R0 _?=$TEMPBASEDIR' ;copy the uninstaller to a temp file -- no reboot page
kichik
17th October 2006 10:12 UTC
Both are not what I mean. I mean you should copy the uninstaller to the temporary directory yourself before executing it. This way it'll be able to delete "itself" from the real installation directory.
CopyFiles $INSTDIR\uninstaller.exe $TEMP
ExecWait '"$TEMP\uninstaller.exe" _?=$INSTDIR'
demiller9
17th October 2006 14:33 UTC
Broadware-
Does it bother your users that it automatically uninstalls the app when the installer starts? I often start an installer just to see what version it is (or even to see what app it is) because one 'setup.exe' looks like another setup.exe. Maybe you could have the uninstaller run later in the process (like after the user has clicked on 'Install').