Archive: Detect reboot

Detect reboot

After installing some windows functionnalities with dism (win2008R2), i need to detect if a reboot is needed.
A reboot is needed because I cannot install a new windows functionnalty.

I have tried this

${If} ${RebootFlag}
Messagebox mb_ok "Rebook detected"
Push $R1
Call RestartRequired
Exch $R1
StrCmp $R1 "1" RestartRequired noreboot
I have found this function on the wiki.

Is there a solution to detect a pending reboot?


What about IfRebootFlag?

IfRebootFlag 0 noreboot
MessageBox MB_YESNO "A reboot is required to finish the installation. Do you wish to reboot now?" IDNO noreboot
This only works inside the nsis script, though. If an external setup program requires a reboot then I don't know how to get that information with nsis. Or, if you know one of the external programs needs a reboot, then you can force a reboot from nsis anyway.

Oh, and your code should look like this:
${If} ${RebootFlag}
Messagebox mb_ok "Rebook detected"