Configuring Installation Rollback Behavior

InstallAnywhere 2018

If an end user cancels an installation before it has completed, or if a fatal error occurs during the installation, the result can be an incomplete, corrupt application. To avoid this problem, you can enable installation rollback by selecting the Enable Rollback check box in your project (Advanced Designer > Project page > Advanced view). This Enable Rollback check box is selected by default for all new projects that you create in InstallAnywhere.

If rollback is enabled in an installation, and the end user cancels the installation or a fatal error occurs, the installer automatically reverts what has been altered or added to the system. The installation log contains all status messages, including the action that triggered the rollback.

If you select the Enable Rollback check box, the Restart Windows in case of Rollback check box becomes available, allowing you to select or clear this check box. Select the Restart Windows in case of Rollback check box to instruct a Windows-based target system to restart after a rollback occurs during installation. If this check box is selected, the target system restarts once the end user clicks the Done button on the Install Complete panel.

Note • If the Restart Windows in case of Rollback check box is selected, the Windows-based target machine restarts regardless of whether a Restart Windows action is present in the Post-Install sequence, with one exception. If a Restart Windows action is present and you assign to it a rule that would prompt the end user to choose between Yes, restart or No, I will restart later, and if the end user selects the No option, the machine does not restart—regardless of whether the Restart Windows in case of Rollback check box is selected.

Fine-Tuning the Rollback Behavior Through the Install Sequence

On the Rollback tab of action customizers in the Install view of the Sequence page, you can specify rollback behavior on a file-by-file basis. You can fine-tune how the installer treats individual project elements during a rollback and can specify which project elements would trigger a rollback if the installation of that element fails.

If the Enable Rollback check box is selected in the Advanced view of the Project page, you can select the options on the Rollback tab of action customizers in the Install view to specify rollback options for the selected project element. Available check boxes are:

If rollback is triggered at install time, uninstall this action/resource—If you want the selected project element to be uninstalled if the product installation is cancelled or encounters a fatal error, select this check box. If this check box is not selected and a rollback occurs, the project element is not uninstalled.
If a fatal error occurs on this action/resource at install time, trigger uninstall—If you want a rollback to be triggered if the selected project element fails to execute properly or to be installed properly, select this check box. If this check box is not selected and the execution of this action results in a fatal error during installation, a rollback is not triggered.

By default, both check boxes are selected for all project elements.

Disabling the Cancel Button

The end result of disabling the Cancel button depends upon whether the Enable Rollback check box in the Advanced view on the Project page is also selected. The following table presents the two scenarios:

Interaction of Disabled Cancel Button with the Enable Rollback Check Box State

State of the Enable Rollback Check Box

Resulting Behavior

Not Selected

The Cancel button and the window close button are disabled.
If a fatal error is encountered or a Trigger Rollback action occurs, the installation completes with errors. Rollback is suppressed.

Selected

The Cancel button and the window close button are disabled.
If a fatal error is encountered or a Trigger Rollback action occurs, rollback is initiated.

Note • This same behavior occurs in maintenance mode–enabled projects when the end user attempts to add features, remove features, or repair the product.

Using Trigger Rollback Actions

You can also choose to add a Trigger Rollback action to the Install sequence to specifically initiate a rollback if a certain rule or condition is met. For more information, see Trigger Rollback Action.

About Rollbacks and Custom Code

Note that if you want to trigger a rollback from custom code, you need to throw an exception of type FatalInstallException.

If you want to execute some custom code during a rollback, you can include the custom code in the Uninstall sequence and add a rule to execute it only when the $IA_ROLLBACK$ variable is set to TRUE.

See Also