How to resume installation after reboot

Article:HOWTO8366  |  Created: 2005-11-18  |  Updated: 2007-08-21  |  Article URL http://www.symantec.com/docs/HOWTO8366
Article Type
How To


Question
How do I resume the setup program after a reboot?

Answer

In order to have the setup restart after the reboot, you will need to manually add the path to your .msi into the RunOnce key (shown below), then conditionalize the dialogs so they do not display the second time through.

  1. Select the line in the upgrade .msi right after FindRelatedProducts action in the Execute Immediate script. 
  2. Double-click on the Run WiseScript from installation action. A dialog will open. 
  3. Name the WiseScript (something meaningful to you, such as Setup Runonce), then select the Options button. 
  4. Select Create New WiseScript.
  5. Add the following registry key into the WiseScript so that they are placed down when the upgrade is run. 

    Note: Use the Current User vs the Local machine key if the installation is a per user install.

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
  6. The value for the RunOnce key should be the OriginalDatabase property in square brackets. The OriginalDatabase property holds the path to the .msi that is getting executed.
  7. Another registry key should also be added in the WiseScript that will set a flag. The flag indicates that the installation was run once on the computer. This can be any registry key, and it will be checked later by the installation.
  8. Compile the WiseScript and close it. You will then return to the Installation Expert script with the dialog open. 
  9. Select OK on the Run WiseScript from Installation Details dialog to close the dialog.
  10. Conditionalize the execution of the WiseScript you just added by placing an If Statement before the Run WiseScript from Installation action and and End Statement after. The condition in the If Statement should check to see if the installation is running as an upgrade.

    The property to use in the If Statement can be found in the Upgrade page in the Upgrade dialog in the Action Property field. It is usually UPGRADE_1, but may be incremented to UPGRADE_2 or UPGRADE_3. Placing this condition down will ensure that the runonce key is only set for upgrades. This property will resolve to true if it is an upgrade and false if it is not. The Windows Installer evaluates a property to true or false based on if it is populated. The Upgrade property will not be populated if it is not an upgrade and will evaluate to false and not execute the WiseScript if it is not an upgrade.
  11. Go to the System Search page, and create a search for the registry key that you placed using the WiseScript.  Create a property value that will hold the results of the search.
  12. Set a property on the dialogs that will not disable the dialogs if the application runs a second time. The property from the System Search should be used to conditionalize the dialog. It will check if it is the second time through and not display the dialogs again. 

    On all displayed dialogs, check to see if the property that you placed in the WiseScript has been set using the System Search as described in Step 11. You can do this in the Dialogs page of Installation Expert. Double-click on a dialog and edit the Condition for the dialog. If a condition already exists append the additional condition to the existing condition by appending AND NOT <PROPERTY>. The property value here should be the property created in the system search.

Legacy ID



3956


Article URL http://www.symantec.com/docs/HOWTO8366


Terms of use for this information are found in Legal Notices