Custom Actions - Rollback - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

sdm10101
Posts: 35
Joined: Wed May 06, 2009 2:13 pm

Custom Actions - Rollback

I'm using a custom action during rollback to ensure that a folder that is backed up (using a custom action during install) is restored.

Unfortunately, my rollback custom action is not occurring.
I'm not sure that an actual rollback is occurring, either.

What could be the problem?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Actions - Rollback

Hi,

A rollback custom action should be scheduled before the action it rolls back. In your case, you can schedule it before the custom action which performs the folder backup. A rollback custom action should also use the "Rollback" execution option in the Custom Action Properties pane. Please note that a rollback can be triggered only by a custom action scheduled between "InstallInitialize" and "InstallFinalize" standard actions.

If you configured your custom action this way and the problem persists, please send us the .AIP (project) file and a verbose log of the install process to support at advancedinstaller dot com so we can investigate them.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sdm10101
Posts: 35
Joined: Wed May 06, 2009 2:13 pm

Re: Custom Actions - Rollback

I'm a little confused.

I currently have my restore custom action within the rollback standard action and my backup custom action within the install standard action.
If I have the backup custom action's execution as deferred, then the installer does this backup AFTER it has already over-written the folder, thus it backs up the NEW folder instead of the old one. If I set the exection to immediate, then the rollback doesn't 'fire' the restore custom action.

Firstly, is it correct (as intuation tells me) that the restore custom action should be within the rollback standard action (execution = rollback); and that the backup custom action should be within the install standard action (with what execution?).

Secondly, can I place them both anywhere as long as they're in the correct order and have the correct executions and are between initalizeinstall and finalizeinstall?

What would be the most sensible setup (of these two files) to facilitate:

1.. User enters info (folders, servers, etc)
2.. Do backup of previous version's folder
3.. Do Install
4a.. If install ok then we have New folder AND Old backed up folder
4b.. If install NOT ok then Old backed up folder replaces New folder so app is as it was before this install
sdm10101
Posts: 35
Joined: Wed May 06, 2009 2:13 pm

Re: Custom Actions - Rollback

Ok. I think I've resolved this.

What I have done is the following:

1.. I have put the restore and backup custom actions under the InstallInitialize standard action.
2.. Restore is before backup.
3.. Restore (obviously) has an execution of Rollback; Backup has an execution of deferred.
4.. They both use Action Data to pass details to the vbs code via the CustomActionData property.


NB (for note 4): Things entered in the 'Action Data' box can be text or properties, and they are picked
up in the vbs using Session.Property("CustomActionData").

If there's a better (or more standard) way, please post.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Custom Actions - Rollback

Hi,

This is the correct approach. The backup custom action runs before the new files are installed and the rollback custom action is scheduled before its target action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”