Archive: Uninstall in onInit w/o reboot page


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.


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.


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.


This is what he means:

ExecWait '$R0 _?=$TEMPBASEDIR' ;copy the uninstaller to a temp file -- no reboot page


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'

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').