|
|
#1 |
|
Guest
Posts: n/a
|
I'm trying to construct the following:
My setup detects whether or not it has been installed already and gives a message about this observation. If the user chooses not to overwrite (so make a backup) then my setup copies everything it can discover in $INSTDIR to $TEMP and calls the uninstall of the previous (installed) version. If this uninstall was succesful, the setup continues installing the new version. 2 problems: 1) is there a way to execute the uninstall "silently"? Normally the uninstall contains things like "You're uninstalling!!! Continue???". Can the new setup shut these things down at runtime and run the uninstall silently? 2) the setup executes the uninstall using ExecWait, but it actually doesn't wait for the uninstall to be closed. The setup just continues and (obviously) observes that uninstall was not succesfull. How can I get the install to wait for the uninstall? thx, greetz, - Hendri -
|
|
|
|
#2 |
|
Guest
Posts: n/a
|
does nobody have an answer to my questions above???
Please help me out... Thx, - Hendri -
|
|
|
|
#3 |
|
Moderator Alumni
Join Date: Apr 2000
Location: USA
Posts: 315
|
If the uninstaller was generated with 1.7b2 or later, you can do this:
code: And that will silently uninstall and wait. The /S switch will be ignored on earlier uninstallers, but the uninstaller will be executed and waited for though. -Justin |
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
thx...
Thx Justin!
I'll try your solution. Greetz, - Hendri -
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Detection of silent uninstall
Still a question about this silent uninstall:
How to detect at runtime that my uninstall is run silently? The problem: the /S parameter disappears from the commandline at run time, so I cannot check this... My Uninstall has to know this to be able block usermessages like MessageBox MB_YESNO "You are uninstalling! Continue?" Thx, - Hendri -
|
|
|
|
#6 |
|
NSIS Dev
Join Date: Sep 2001
Location: Leicester, UK
Posts: 193
|
When the uninstaller has _=$INSTDIR passed to it you should find that the problem of other parameters going missing will stop. The uninstaller normally copies to and relaunches itself from the $TEMP directory, but the presence of the _= parameter fools it into thinking this has already happened.
Btw, here's a general purpose function I use for getting parameters from the command-line that hopefully might be useful. e.g.code: code: Good luck Dave. |
|
|
|
|
|
#7 |
|
Guest
Posts: n/a
|
Thx Dave,
your solution (GetNextParm) work great! Besides that I would like to inform you about the fact that the solution by Justin (with /S parameter and deleting uninstall after the actual uninstall) doesn't work on slow machines (like mine). After ExecWait returns, Windows hasn't really shut down the program, so we cannot delete it. Use something like: code:----------------------------------------------------------------- ExecWait '"$INSTDIR\uninst.exe" /S _=$INSTDIR' Sleep 500 ; wait for the uninstall to close Delete $INSTDIR\uninst.exe ; the uninstaller won't be able to delete itself when run above. ---------------------------------------------------------------------- This works fine on my machine! Good luck, thx again Dave, greetz, - Hendri -
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|