cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TimoZimmermann
Level 5

CustomAction called twice on Major Upgrade

I have a custom action sequenced after InstallFinalize. If I run a major upgrade then I have the problem that my custom action is called twice. It seems from the old package first and then again from the new package.

How can I avoid the first call? It should only call the custom action from the new package at the end?
Labels (1)
0 Kudos
(6) Replies
RobertDickau
Flexera Alumni

A major upgrade performs (in effect) a silent, nested uninstallation of the old package or packages, performing any custom actions that would normally be performed.

For an older package to determine if it's being removed by a major upgrade, it can check the UPGRADINGPRODUCTCODE property, which can be used in a condition on a custom action that shouldn't run during removal by a major upgrade...
0 Kudos
TimoZimmermann
Level 5

thanks for the answere. I know the UPGRADINGPRODUCTCODE. But the problem is, that when I use this for the custom action it will be never called in an update - neither in the nested uninstallation sequence nor in the update sequence. I want that the custom action is only not called in sequence of the nested uninstallation of the old package but in the installation sequence of the new package it should be called. Is this possible?
0 Kudos
RobertDickau
Flexera Alumni

What is the condition, Not UPGRADINGPRODUCTCODE? If you create an MSI log file, is there any more information about why the action runs?
0 Kudos
TimoZimmermann
Level 5

When I'm using the condition "Not UPGRADINGPRODUCTCODE" for the custom action this custom action will not be called in the nested uninstallation nor in the new setup. But in the new setup it should be called. Any idea?
0 Kudos
KathyMorey
Level 10

UPGRADINGPRODUCTCODE is only set in the nested uninstall of the old product, not in the install of the replacement. The action property in the Upgrade table item (default ISACTIONPROP1) gets set in the new install when it finds the related existing product, then UPGRADINGPRODUCTCODE is set on the uninstall's command line.

So using "Not UPGRADINGPRODUCTCODE" as the condition should work for the scenario you describe. If you find that the CA doesn't run for the new install, or that it does run for the uninstall, then you have another issue and will need to examine your log files for the cause.
0 Kudos
TimoZimmermann
Level 5

you're right. It works as you describe. Thank you 😄
0 Kudos