Summary
Making a Setup Continue after a RebootSynopsis
Applies to InstallScript projects. This article discusses how to create a setup that reboots during a certain point in the install, before any data transfer events have occurred. After the reboot, the setup launches again and continues on from the same location it left off from.
Discussion
This can done by making an entry into the RunOnce key in the registry, located under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
The RunOnce key contains the path to the installation setup.exe file so that it starts again after reboot, but the RunOnce key path also includes a custom command-line switch so that you can easily detect if the setup.exe was executed by the RunOnce key. Then using the CMDLINE system variable, you can look for this custom command-line switch and skip through code that was executed during the initial installation.
For example, a reboot can be called by using the System(SYS_BOOTMACHINE) InstallScript function in the OnFirstUIBefore() event. Just before this reboot call, an entry can be written to the RunOnce key using the RegDBSetKeyValueEx() function, which launches the command SRCDIR^"setup.exe". Additionally, the custom command line "-test" can be appended to the "setup.exe" path string and all this can be written to the RunOnce key.
Then you can wrap your code in the OnFirstUIBefore() event with an if-else-endif statement. You can check to see if the custom command line switch '-test' appears in the command line variable, CMDLINE. If not, you will execute the beginning of your code in OnFirstUIBefore() up until the code which is handling the reboot. However, if you do see '-test- inside of CMDLINE, then you can skip to the code after the reboot and continue your installation from there.
Additional Information
For more information on the CMDLINE variable, see the InstallShield Help topic:
? CMDLINE
Related Articles
Detecting When a Reboot Is Necessary 15Number of Views Checking If a Reboot Will Occur 3Number of Views Prompt for a Reboot After Install 3Number of Views Making a Control Over a Bitmap Visible on MSI Dialog 3Number of Views Font Uninstall Triggers a Reboot Prompt if Font is Not Installed in FontsFolder 5Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago