mumbles76
Posts: 29
Joined: Mon Nov 16, 2015 7:29 pm

Run Custom Action on Uninstall not on Major Upgrade

Hello All

(Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ))

Is this the best condition to use when removing a program from add/remove programs? Not NOT to execute on major upgrades?
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Run Custom Action on Uninstall not on Major Upgrade

Hello,

As I can see, you want to execute a custom action only on Uninstall sequence and it is a regular uninstall (e.g. the uninstall process is triggered from Control Panel), not when the uninstall is triggered by a major upgrade.

In this case, you should use the following condition:

Code: Select all

( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE )
Please let me know if everything is working as expected.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mumbles76
Posts: 29
Joined: Mon Nov 16, 2015 7:29 pm

Re: Run Custom Action on Uninstall not on Major Upgrade

I'm going to try

Code: Select all

( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT OLDPRODUCTS )
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Run Custom Action on Uninstall not on Major Upgrade

Hi,

Can you please give me more details about your specific scenario? Why the condition is not good?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mumbles76
Posts: 29
Joined: Mon Nov 16, 2015 7:29 pm

Re: Run Custom Action on Uninstall not on Major Upgrade

We write some registry values via a powershell custom action. We also have a delete registry entries on uninstall custom action.

That delete registry entries custom action was still running on major upgrades with your condition.

Return to “Building Installers”