Cannot invoke custom action during rollback - Advanced Installer Community
tomas.maruska
Posts: 38
Joined: Fri Jul 19, 2013 11:49 am

Cannot invoke custom action during rollback

Hello,

I have custom action, which executes some DB scripts (number 1 on screenshot). And I want to rollback it in case something goes wrong. So, I made another custom action which should return DB to original state (num 2 on screenshot).

For test purposes, I returned 'Failed' from last custom action in sequence (num 3 on screenshot) and I added MessageBox.Show(...) into custom actions #1, #2 and #3.

When installing I get MessageBox for #1, then #3. After action #3 setup starts rollback, which is absolutelly correct. But, then rollback ends without invoking my custom action...

Can you tell me what am I doing wrong?

I'm using Advanced Installer v10.5.2. Find attached screenshot and logs from setup described above.

Thanks
Attachments
log.zip
(66.9 KiB) Downloaded 270 times
ai.PNG
ai.PNG (117.16 KiB) Viewed 3003 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Cannot invoke custom action during rollback

Hi,

Please keep in mind that a "rollback" custom action is always executed when the system is being modified (deferred), hence if your #1 and #3 custom actions are executed "immediately", the #2 (rollback) custom action is not reached when the #3 custom action throws an error code and that is why it is not executed.

So, in order to achieve what you want you can set the #1 and #3 custom actions to be also executed when the system is being modified (deferred), or you can just drag and drop the #2 custom action above the "Remove Resources" action group in which case it will always be executed during rollback.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tomas.maruska
Posts: 38
Joined: Fri Jul 19, 2013 11:49 am

Re: Cannot invoke custom action during rollback

Thank you, I moved rollback action above "Remove Resources" and it was invoked.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Cannot invoke custom action during rollback

You're welcome. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”