This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- What happens if rollback custom action fails?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Feb 14, 2011
06:02 AM
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,
Lior.
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,
Lior.
(3) Replies
‎Feb 14, 2011
11:37 AM
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 ......
‎Feb 15, 2011
06:32 AM
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?
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?
‎Feb 15, 2011
07:35 AM
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?
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?