Archive: Reboot finish page and problem


Reboot finish page and problem
1) Is there a way to make the installer always reboot besides setting the SetRebootFlag = true in the script?

2) Is there a way to detect that the user selected 'Restart Now' or 'Restart Later' option from the reboot finish screen?

I want the installer to always reboot after the product is installed, at the same time I only want to launch the product only if the user selected 'Restart Later' option. I've tried using IfRebootFlag value but it’s always true since in the script I manually set SetRebootFlag to true (so I always get the reboot screen at the end of installation). As a result, our product is caught in a situation where the installer launches the product and at the same time it's rebooting the machine. It creates a bad user experience. It'll be great to get an answer to the above two questions. Thanks!


If you want to always reboot, don't use the finish page and simply call Reboot yourself.

I don't see why you'd like to execute your product if the system will always reboot, but if you want to check the radio buttons, simply do so in the leave callback function of the finish page.


Originally posted by kichik
simply do so in the leave callback function of the finish page.
What is the "leave callback function of the finish page"?

I searched the NSIS User Manual but all I could find was .onGUIEnd. Is this it?

Each page can have a create function and a leave function (sometimes called a callback function). The leave function runs when the user clicks "next" (or in this case, finish) just before the page unloads. This gives you the ability to use an "abort" to prevent the next page from loading.

For more info, search the NSIS manual for the Page and PageEx commands. Also check out some of the sample scripts included with NSIS. And if you use the MUI (modern user interface), make sure you read the MUI docs as there are special macros there to use for defining page callbacks.)


Originally posted by Comperio
For more info, search the NSIS manual for the Page and PageEx commands.
Thank you! This is great education for me.

BTW, regarding the original subject (which prompted my question) I managed to solve it by using MUI_FINISHPAGE_TEXT_REBOOT and 'SetRebootFlag true'. I am using MUI2 and it is great as it has most of what I need built in.