Archive: Reboot xp help


Reboot xp help
I would be pleased to get a reboot function into my NSIS installer, which is for the Windows XP system.

But I am very confused which function/code I can use, and where to put it. I have not included a finish page.

My english is not that good to understand what to do here. I have read the NSIS documentation and seach this forum, but cant figure it out. Hope that somebody can help me out! :eek:


Use the Reboot command to reboot.

If you want to check whether a reboot is required (NSIS has set the reboot flag), use IfRebootFlag.


thanks alot, but where should I place the command reboot? In the last section or?


maybe this help

;Uninstaller Functions

Function un.onUninstSuccess
MessageBox MB_ICONINFORMATION|MB_OK " <blah> success"

IfRebootFlag "" norebootdone

MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 " <blah> reboot?" IDNO noreboot
REBOOT
Abort

noreboot:
MessageBox MB_ICONINFORMATION|MB_OK "<maybe another info text>"
Goto norebootdone

norebootdone:

FunctionEnd

So;


Function .onInstSuccess
MessageBox MB_ICONINFORMATION|MB_OK "Installation completed successfully."

IfRebootFlag 0 no_reboot_done

MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "To complete the installation, your PC must be rebooted.$\r$\n$\r$\nWould you like to reboot now?" IDNO no_reboot
REBOOT
Abort

no_reboot:
MessageBox MB_ICONINFORMATION|MB_OK "You must do a reboot before you can use ${MUI_PRODUCT}."
no_reboot_done:

FunctionEnd


-Stu

Great, thanks. It works beautyfull now :-)