|
|
|
|
#1 |
|
Member
Join Date: Feb 2005
Posts: 51
|
Uninstaller does not reboot if run from installer
My installer code runs the uninstaller (in .onInit) if it detects the software is already installed. Once the software finishes uninstalling, it continues with the installation.
I am using "Delete /REBOOTOK" to delete files in my uninstaller. If one of the files cannot be deleted, it asks the user to reboot the system. 1. If I intentionally lock a file, run the uninstaller directly, and the user agrees to reboot the system *does* reboot. 2. If I do the same, but launch the uninstaller from inside the installer, it does *not* reboot. The installer is invoking the uninstaller using this code: code: Why isn't the uninstaller rebooting? Thanks, Gili |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 462
|
Windows 'knows' that the installer is running and prevents the reboot. I had a similar problem and solved it by making the uninstaller terminate the installer.
|
|
|
|
|
|
#3 |
|
Member
Join Date: Feb 2005
Posts: 51
|
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
The installer is blocking the reboot IIRC, I think there is a plugin that prevents it from doing that...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Member
Join Date: Feb 2005
Posts: 51
|
|
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
|
|
|
|
|
|
#7 |
|
Member
Join Date: Feb 2005
Posts: 51
|
Excellent. Thanks Stu!
![]() Gili |
|
|
|
|
|
#8 |
|
Member
Join Date: Feb 2005
Posts: 51
|
Okay, now I've got one more problem... The uninstaller is causing the system to reboot, but in the meantime it returns control back to the installer which allows the user to begin installation.
I noticed that the uninstaller is returning exit code 164 (or -164, I forget). Where does this number come from? Is it documented somewhere? Can I rely on it not changing? Thanks, Gili |
|
|
|
|
|
#9 |
|
Member
Join Date: Feb 2005
Posts: 51
|
Hmm, it seems I jumped the gun. I get an exit code of 164 whether the uninstaller reboots or not. Any ideas on how to tell the installer to abort when the uninstaller tries to reboot?
|
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Looking at the source it just returns the current error level (SetErrorLevel) so perhaps something in your script is setting it to 164. You can try setting your own error level just before rebooting.
Stu |
|
|
|
|
|
#11 |
|
Member
Join Date: Feb 2005
Posts: 51
|
I stand corrected. I'm getting error code 0 (not 164) whether it reboots or not.
|
|
|
|
|
|
#12 |
|
Member
Join Date: Feb 2005
Posts: 51
|
Stu,
Which function gets executed if the user chooses to reboot (I'd like to SetErrorLevel there)? I believe the reboot flag is being set by "Delete /REBOOTOK". I never explicitly set it. |
|
|
|
|
|
#13 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Stucode: |
|
|
|
|
|
#14 |
|
Member
Join Date: Feb 2005
Posts: 51
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|