While testing on Windows Server 2012 R2 I found that ExitWindowsEx (the Reboot instruction) does not actually reboot the machine if the installer was launched from a domain user. This is the case even if the original user was a domain administrator and the installer was elevated as a local administrator. The installer has the Windows 8.1 supported OS GUID embedded in its XML manifest and this has no effect.
The only situation where ExitWindowsEx reboots correctly is when the original logged in user is a local administrator. In every other case, the machine appears to do a quick reboot without a full power cycle. This means that operations that require a full reboot cycle never occur - such as replace on reboot operations (/rebootok).
The fix is to use the newer InitiateSystemShutdownEx API. I could not find anything about this on MSDN.
I have included a patch for NSIS 3.0a2 which calls InitiateSystemShutdownEx instead of ExitWindowsEx if it is available (uses myGetProcAddress). I have tested the Reboot instruction with the new code on Windows XP x86, Windows Vista x86, Windows Vista x64, Windows 7 x86, Windows 7 x64, Windows 8 x86, Windows 8 x64, Windows Server 2012 R2 x64.
Log in to post a comment.