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 ...

Get WiX: A Developer's Guide to Windows Installer XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.