Level 6

What happens if rollback custom action fails?

Hi All,
I've just wondered if anyone can answer this situation.
I'm writing now rollback custom action that does some actions.
these actions can be failed and throw exception. Therefore the installer will return ActionResult.Failure thus terminating the rollback sequence.

Can this be avoided?

To be more specific :
I write deferred custom action that changes text file.(this text file is not an installed file , means its already in the INSTALLDIR, means the Installshield rollback sequence wont revert it to its original state)

Therefore, I write rollback custom action that changes the file back to its original state.
However, this rollback custom action can fail too.(for example
StreamReader reader = new StreamReader(filePath); cant find the file, thus it throws an exception)

So, What happens if it fails?
A second rollback initiates?

I'll be thankful for any answer,
Labels (1)
0 Kudos
3 Replies
Level 9

I was wondering,If your action is already marked for rollback in your case the deferred action, why would you need a rollback action explicitly ......
0 Kudos
Level 6

I'm sorry but I didnt understand your question..maybe because of lack of my InstallShield experience.
What do you mean when you say the action is marked for rollback?
Isnt it the same as making an explicit rollback custom action(for the deferred one) that returning the system to its original state?
0 Kudos
Level 6

to be more precise here is a flexera help quote:

When the installer processes the installation script, it simultaneously generates a rollback script. In addition to the rollback script, the installer saves a copy of every file it deletes during the installation. These files are kept in a hidden system directory. Once the installation is complete, the rollback script and the saved files are deleted. If an installation is unsuccessful, the installer attempts to rollback the changes made during the installation and restore the original state of the computer.

Although custom actions that schedule system operations by inserting rows into database table are reversed by a rollback of the installation, custom actions that change the system directly, or that issue commands to other system services, cannot always be reversed by a rollback. A rollback custom action is an action that the installer executes only during an installation rollback, and its purpose is to reverse a custom action that has made changes to the system.

this is a file that i didnt delete,its a file that is already ont the target system, so it wont change back.
Therefore if i change it, the rollback will not cgange my file to its original state. So i wrote an explicit custom action that changes it back to its original state.
BUT What happens if when I change it back , the rollback custom action fails?
0 Kudos