Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 15th December 2009, 22:37   #1
Lucky75
Junior Member
 
Join Date: Jul 2007
Posts: 15
Force uninstall->Reboot->New Install

Hi all,

I have an installer where if I am updating versions, I need to uninstall the old stuff, reboot, and then reinstall the new software, all from the same executable.

Is there an easy way to do this and have it resume?

My other option is to set a registry flag, copy the installer to some temporary directory, and then have it determine that the registry flag was set so I need to skip sections, but I would prefer to not have to do that manually.

Thanks for the help!
Lucky75 is offline   Reply With Quote
Old 15th December 2009, 23:40   #2
redxii
Senior Member
 
Join Date: Nov 2005
Posts: 113
You'd use this key to launch the installer after a reboot:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "MyInstaller" "$EXEPATH\$EXEFILE"
redxii is offline   Reply With Quote
Old 16th December 2009, 03:29   #3
Lucky75
Junior Member
 
Join Date: Jul 2007
Posts: 15
Yeah, that's not the problem. Is there some way to set where I want to resume in the installer script, or to resume where I left off, or call a function or something? Without just setting it as value in some key in the registry?
Lucky75 is offline   Reply With Quote
Old 16th December 2009, 07:52   #4
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 546
You can add a parameter to the path in this registry entry (like '"$EXEPATH\$EXEFILE" /RESUME=YES'),
and then check on startup of the installer if this parameter is set with GetParameters and GetOptions, and skip the code you want.
jpderuiter is offline   Reply With Quote
Old 16th December 2009, 15:52   #5
Lucky75
Junior Member
 
Join Date: Jul 2007
Posts: 15
Thanks. How would I actually use GetOptions to get the value of the resume parameter in a variable? The help file is rather vague.
Lucky75 is offline   Reply With Quote
Old 16th December 2009, 16:59   #6
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 546
code:
${GetParameters} $R0 ;copy all parameters to $R0
${GetOptions} "$R0" "/RESUME=" $R1 ;copy RESUME value from $R0 to $R1
IfErrors 0 +2
MessageBox MB_OK "RESUME value not set" +2
MessageBox MB_OK "RESUME value set: $R1"

jpderuiter is offline   Reply With Quote
Reply
Go Back   Winamp 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