View Full Version : Continue Installation after Reboot

08-03-2005, 03:10 PM
Hi, Im fairly inexperienced with rebooting an installation. What I want to do is reboot the system after the files have been installed and call the OnRebooted event handler to perform some more actions that are required after a reboot. I am using an InstallScript MSI project. Ive tried using the reboot dialogs but I think those are meant more for simply restarting the system after the installation is complete, where in my case I wish to continue the installation after restarting. Basically, I just want to know how to call the OnRebooted event handler after reboot. Thanks in Advance. All suggestions are welcome.

08-04-2005, 08:13 AM
I know I have not found a way to force the internal OnReboot event to continue setup.

I do have scripts that have to continue after a reboot. I accomplish this by manually writing to the RunOnce key to restart the setup and in the OnBegin event I capture the CMDLINE options to see if my manual flag is there to indicate that setup should continue from where it left off.

If placing the code to restart your setup in the RunOnce key forces it to restart too early in the boot process, then create a temporary shortcut that you place in the Startup program group - these are processed last in the reboot cycle.

08-04-2005, 10:21 AM
Thanks, that sounds like it might work. However, how exactly did you indicate in the command line for the setup to continue from a set point in the sequence?

08-04-2005, 12:17 PM
Unfortunately I had to set a global boolean and then encapsulate all my code within that global boolean. It was a tough way of implementing the code but workable.

08-05-2005, 11:49 AM
Well, I was able to have the setup run again after reboot by setting the following value to the RunOnce key:
In order to get the system to reboot, I used the ForceReboot action, as I could not get the System(SYS_WINROOT) function to work. Apparently, running ForceReboot sets the AFTERREBOOT property to 1. With that in mind, I set the conditional statement for the ForceReboot action to be "Not AFTERREBOOT". However, upon running the installer automatically after reboot, it still prompts the user to reboot with the ForceReboot action. I also tried setting the command line value in the RunOnce key to "C:\\DISK1\\Setup.exe /AFTERREBOOT=1", with different combinations of reboot, i.e. ".../AFTERREBOOT = 1, ...AFTERREBOOT=1, ...AFTERREBOOT = 1". This still has no effect.
Im not exactly sure how you would go about setting up a global boolean if this property is not getting set, or what other method you would use for the installer to determine whether it has been rebooted or not.