Dashut
Posts: 142
Joined: Tue May 04, 2010 4:41 pm

Can't make Rollback CustomAction call

Using AI 7.7:
I added a Custom Action in "InstallExecuteSequence"->"Rollback" for my tests that pops-up a MessageBox without any conditions and is configured to be: "Rollback with no impersonation".
Now I try to make this MessageBox appear, but nothing causes it to pop-up.
I tried installing the msi, and at the welcome page pressing "cancel": but the only thing that happened is that the installation ends with "The <my program> Setup Wizard was interrupted" and then you press the "finish" button.
I tried pressing the "cancel" button after I finished with all the dialog windows (== after finally pressing: "install"), but that didn't work either (I got to the same ending page like I mentioned above).
I even tried your custom action "Error" which after showing an error message it fails the installation. But that also didn't cause my custom action in the rollback to be called, but instead ended with a dialog which is a little different then before: "The <my program> Setp Wizard ended prematurely".

So what I want to do is this:
1. Have a "rollback" custom action that's called if installation fails.
2. How can this be done? (as explained above, I tried what seemed to be logical: and create my custom action under "Rollback" with "Rollback with no impersonation": but it was NEVER called...)

Many thanks, Dashut.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Can't make Rollback CustomAction call

Hello Dashut,

You need to place the "Message Box" custom action before the standard/custom action of which effects you wish to reverse, not under the "Rollback" standard action. Usually actions placed after "Rollback" are for "Install" custom actions. If there is a custom action that is executed before "Install", then its corresponding rollback custom action must be moved as well.

When a rollback is triggered, only the rollback custom actions that have been added to the installation script get executed. If the user presses the cancel button before a rollback custom action is added, then this action will not be executed. Also, the rollback can be triggered only after InstallInitialize. If the user cancels the installation from the UI, then there can be no rollback because nothing got modified on the target machine.

For more details please follow this link.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”