a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

[solved] Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

Hi Folks,

so this is a difficult one. :)

I have a custom roll back action that copies files to the [APPDIR]. As most of these files have the same name as the files beeing installed, the copied files from the rollback action will be deleted by the standard roll back actions. I would love to run my rollback action AFTER the installed files were removed by the standard action.

Is that possible?

Se Case: Our product is already running at our customers and we now want to move to a MSI lifecycle. In case our first MSI install fails, I want to recover the original state.

Thanx heavily thinking on that in advance,

Angelo
Last edited by a.guelle on Thu Mar 03, 2016 2:47 pm, edited 3 times in total.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

Hello Angelo,

To achieve what you want you should schedule your restore files custom action just before the "Install Execution Stage -> Remove Resources" action group on rollback. The installed files are removed on installation rollback during the "Remove Resources" action group. Also, on installation rollback the rollback custom actions are executed from the last action executed (when an error occurs) up to the first action from the execution stage. Therefore, you should scheduled your rollback custom action just before the "Remove Resources" action group.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

Hi Daniel,

My Custom Action is a "Launch installed file" action. I pass the property [APPDIR] via the command line arguments. If I set the action before Remove Resources it will never run as the installed file will be deleted on rollback. (does not work)

I could run an inline action before Remove Resources but Session.Property("APPDIR") returns an empty vlaue. (does not work)



Angelo
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

And just when reading my own explanation I see the solution :)

I have to add my custom action files as "temporary files" so that they will not be deleted during the rollback.
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: [re-opened] Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

It turned out that this solution does not work any longer. Even temporary files are now removed during the "Remove Resources" stage (I could swear that was different few month ago).

So again my question:

"I have a custom roll back action that copies files to the [APPDIR]. As most of these files have the same name as the files beeing installed, the copied files from the rollback action will be deleted by the standard roll back actions. I would love to run my rollback action AFTER the installed files were removed by the standard action."

Best regards,

Angelo
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: [re-opened] Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

Hello Angelo,

Can you try to use a "Launch attached file" custom action added on rollback before the "Install Execution Stage -> Remove Resources" action group and see if this helps?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: [solved] Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

Hi Daniel,

I move my scripts to another location after they are installed and run them via "Launch File". This is smimilar to your idea and works perfectly.

Thank you very much,

Angelo
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: [solved] Custom Action on Rollback: How to copy files to appdir AFTER they are uninstalled

You're welcome Angelo.

I'm glad you got this working.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”