How do I restart the machine after the installation?
The following article uses options that are available starting with the Enterprise edition and project type.
Creating the restart functionality
The reboot prompts showed sometimes by Windows Installer during or after an installation are controlled by the REBOOT property. By using a checkbox on the last dialog of the installation, this property can be configured to give the user control over these prompts.
In order to add a "restart machine" functionality to your installation package, you can follow these steps:
- go to the Install Parameters page and set the "Reboot behaviour" combo to Suppress all reboots and reboot prompts
- go to the Dialogs page and add a checkbox on "ExitDialog"
- in the Properties pane of the checkbox set the "Text" field to Restart machine
- set the "Property Name" field to REBOOT_CHECK
- select the "Finish" button
- create this "Set installer property value" Published control event:
[REBOOT] Force AI_INSTALL AND REBOOT_CHECK
The reverse logic can be used to reboot the machine by default:
- go to the Install Parameters page and set the "Reboot Prompts" combo to Force reboot after install
- go to the Dialogs page and add a checkbox on "ExitDialog"
- in the Properties pane of the checkbox, set the "Text" field to Do not restart the machine
- set the "Property Name" field to REBOOT_CHECK
- select the "Finish" button
- create this "Set installer property value" Published control event:
[REBOOT] ReallySupress AI_INSTALL AND REBOOT_CHECK
REBOOT property
The REBOOT property's possible values are:
- Force - the installation will always prompt for a reboot after it is completed. If the installation is silent, the machine will automatically be restarted at the end of the installation.
- Suppress - the installation will not prompt for a reboot after it is completed, even if one is required. However, this option does not affect the reboot prompts which may appear during the installation.
- ReallySuppress - the installation will not prompt for a reboot while it is running or after it is completed (even if one is required).
These values can be used to control the reboot prompts during or after the installation is completed. For example, you can use a radio button group with two radio buttons:
- "Restart the machine" - this radio button has the "Value" field set to Force
- "Do not restart the machine" this radio button has the "Value" field set to ReallySuppress
Make sure the "Property Name" field in the radio button group's "Properties" pane is set to REBOOT.