Sequencing Rollback Custom Actions
InstallShield 2020
Project:This information applies to the following project types:
Any custom action that is in your installation project and that makes direct changes to the target system should have a rollback equivalent custom action. The rollback custom action can undo those changes in the event of rollback. For example, if you have a custom action that deletes files from the target system, and you do not include a rollback custom action to restore those deleted files, the computer could be left in an unstable state even after rollback has completed. Rollback custom actions behave in a similar way to deferred custom actions. That is, they do not launch when first encountered in a sequence. Instead, they are written to the rollback script, which launches only in the event of a rollback.
When inserting a rollback custom action into a sequence, note the following:
|
•
|
A rollback can occur only during the Execute sequence and not at any point during the User Interface sequence. Therefore, the rollback action must be placed after InstallInitialize and before InstallFinalize in the Execute sequence. |
|
•
|
The rollback custom action must be sequenced before the action it rolls back. In all other instances, the Windows Installer service runs through sequences from top to bottom—the lower the sequence number, the sooner the action launches. In the rollback script, however, the service runs in the opposite direction. Therefore, to launch your rollback action when it is needed, sequence it before the action that it rolls back. |
See Also
Using Custom Actions