Rollback custom actions
Custom actions that are scheduled as "deferred" execute during the Execute sequence's rollback-protected phase. To give those actions rollback capabilities, you'll need to author separate custom actions that undo the work. These are scheduled as "rollback" . Rollback custom actions are scheduled before the action they're meant to revert in case of an error. Here's an example:
<CustomAction Id="systemChangingCA" Execute="deferred" Script="vbscript"> msgbox "Imagine this changes the system in some way" </CustomAction> <CustomAction Id="myRollbackCA" Execute="rollback" Script="vbscript"> msgbox "Imagine this undoes the changes" </CustomAction> <CustomAction Id="causeError" Execute="deferred" Script="vbscript"> return failure </CustomAction>
We'll schedule these during the Execute sequence.
<InstallExecuteSequence> <Custom Action="myRollbackCA" Before="systemChangingCA" /> <Custom Action=...