Old 16th October 2006, 19:11   #1
broadware
Junior Member
 
Join Date: Oct 2006
Posts: 4
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.
broadware is offline   Reply With Quote
Old 16th October 2006, 19:34   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 16th October 2006, 20:23   #3
broadware
Junior Member
 
Join Date: Oct 2006
Posts: 4
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 is offline   Reply With Quote
Old 16th October 2006, 23:57   #4
broadware
Junior Member
 
Join Date: Oct 2006
Posts: 4
This is what he means:

ExecWait '$R0 _?=$TEMPBASEDIR' ;copy the uninstaller to a temp file -- no reboot page
broadware is offline   Reply With Quote
Old 17th October 2006, 09:12   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.
code:
CopyFiles $INSTDIR\uninstaller.exe $TEMP
ExecWait '"$TEMP\uninstaller.exe" _?=$INSTDIR'


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 17th October 2006, 13:33   #6
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
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').
demiller9 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump