Archive: Restart windows


Hey - anyone have an easy way to restart windows from NSIS? Seems like you'd want to after using a /REBOOTOK type command. Tried using ExecShell "" "Exit" but that's no good. The plan is to simulate that info message-box - you know, "You must restart your computer before installation is complete - restart now?"
-Carl


oops
Disregard 'execshell "" "exit"' stuff above - it makes no sense
Although it does seem you ought to be able to execshell _something_...
-Carl


What you want is to execute:
C:\WINDOWS\RUNDLL32.EXE shell32,SHExitWindowsEx 2
for a reboot
(replace C:\Windows with the Windows directory variable)


yeah - tried that, but it's win98 specific, which is no good for my purposes (distribute to all windows platforms).

A safer bet seems to be
Exec "rundll.exe user.exe,ExitWindowsExec 6"
which is 95-compatible. Unfortunately, I wanted it to be compatible with NT as well, which means dealing with all that tokens crap. I ended up just giving up on the scripted solution and writing a tiny app that checks for NT, sets the token if so, and then calls a general reboot api. I install that in the $temp directory and exec it.
-Carl