jbruce
Posts: 3
Joined: Fri Jun 14, 2013 3:25 pm

Uninstall custom actions sometimes performed on Upgrade

We have a custom action for use only during a regular uninstall (no upgrades), since it removes some config files created by the application.

Once in a while, it seems that this action is being executed during upgrades, even though "regular uninstall" is the only execution stage condition that is selected. This is wiping away the config files put in place by the application.

The odd thing is, this does not happen every time. What could be causing Advanced Installer to either execute this action, or clear the install directory itself during upgrades?

Thanks

-John
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Uninstall custom actions sometimes performed on Upgrade

Hello John and welcome to Advanced Installer forums,

An upgrade consists of a complete uninstall of the previous version followed by the installation of the new.

Aside checking the "Uninstall" option, the condition field for that custom action should be set to something like:

Code: Select all

UPGRADINGPRODUCTCODE 
This should ensure the behavior because the property is set in the MSI which is being upgraded if the package is uninstalled by a newer version.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbruce
Posts: 3
Joined: Fri Jun 14, 2013 3:25 pm

Re: Uninstall custom actions sometimes performed on Upgrade

Thanks Mihai.

So if I want a custom action to be performed only when the application is being uninstalled, but not when it is uninstalled as part of an upgrade, I should set the condition field to "NOT UPGRADINGPRODUCTCODE" ?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Uninstall custom actions sometimes performed on Upgrade

Hello,

Yes, in order to achieve what you want you can set the related custom action to run only on uninstall, and in the "Condition" field you can add the NOT UPGRADINGPRODUCTCODE condition. Also, as another solution, you can directly set the "Condition" field like this:

Code: Select all

( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE )
Let us know if this helped, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbruce
Posts: 3
Joined: Fri Jun 14, 2013 3:25 pm

Re: Uninstall custom actions sometimes performed on Upgrade

Hi Daniel,

Unfortunately, this is the condition that we have set on these actions right now, and we're still experiencing the random execution of this action on upgrades.

Are there any other settings I should verify?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Uninstall custom actions sometimes performed on Upgrade

Hello John,

I'm not sure why this happens. Can you please send me the .AIPs (project files), of target and upgraded version of your installation packages, and a verbose log of the upgrade installation to support at advancedinstaller dot com so we can investigate them?

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

Return to “Common Problems”