0
votes

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?

1
You'll need to say which Cancel button. Is it one in the UI sequence? Is it the one that is sometimes shown during the actual install and progress bar? - PhilDW
It is defined through Bootstrapper. - Umar Abbas
Added an answer even though this is quite old. - Stein Åsmul

1 Answers

0
votes

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