How do I restart the machine after the installation?

ImportantThe 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:

  1. go to the Install Parameters page and set the "Reboot behaviour" combo to Suppress all reboots and reboot prompts
  2. go to the Dialogs page and add a checkbox on "ExitDialog"
  3. in the Properties pane of the checkbox set the "Text" field to Restart machine
  4. set the "Property Name" field to REBOOT_CHECK
  5. select the "Finish" button
  6. 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:

  1. go to the Install Parameters page and set the "Reboot Prompts" combo to Force reboot after install
  2. go to the Dialogs page and add a checkbox on "ExitDialog"
  3. in the Properties pane of the checkbox, set the "Text" field to Do not restart the machine
  4. set the "Property Name" field to REBOOT_CHECK
  5. select the "Finish" button
  6. 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

NoteMake sure the "Property Name" field in the radio button group's "Properties" pane is set to REBOOT.