简体   繁体   中英

WiX installer trigger rollback when the user cancels installation

If installation fails during the process, it rolls back recent changes by the installer, but when the user cancels it through the Cancel button the installer just fails and does not rollback recent changes.

How can we trigger a rollback process if the user cancels installation through a button?

Rollback : This is old, but just for the record: if the installer has not hit the installation sequence (where files and registry entries and such things are being added or modified) - as opposed to the user interface sequence (where installation choices and settings are gathered) - there should be nothing to roll back. Rollback happens when the installation has made changes on the system and a fatal error occurs so the whole installation has to be undone. This is after the user interface sequence when you normally see a progress bar on the screen.

Installation Transaction : It is possible to erroneously make changes from the UI-sequence. It is always a design error to do so since no rollback will happen except for actions between InstallInitialize and InstallFinalize in the InstallExecuteSequence . Any other changes done from elsewhere in other sequences will not be rolled back. The sequence from InstallInitialize until and including InstallFinalize is the part of an installation that runs as a transaction that can be rolled back, and all other sequences should not change the system (but sometimes they do).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM