cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Pilgrim

Condition for Custom Action to run only on upgrade

First, I've searched and can't find one, but is there a listing somewhere of all the standard, built-in properties that can be checked in install conditions?

Anyway, here's my situation. We've got an application that we're upgrading and the new version stores data differently. I've got a custom action that runs an InstallScript function to perform some operations to handle a data conversion from the old version's format to the new version's format.

I've made this a Commit execution (I only want to run after I know for sure that the new version is fully and properly installed), and placed it right after InstallFinalize in the Installation Execute sequence.

My real question is, I want to put a condition on this custom action so that it only runs during the INSTALL of the new version, and ONLY when UPGRADING from the old version (don't want it to run on just a new, clean install of the new version). I DON'T want it to run when uninstalling, patching, doing a repair/reinstall, etc.

We will be distributing this as a full package and Major upgrade, and we have the Major upgrade set to completely uninstall the old version first then install the new version.

So what condition should I put on this custom action?

Thank you.
Labels (1)
0 Kudos
3 Replies
Highlighted
Pilgrim

Re: Condition for Custom Action to run only on upgrade

In the upgrades section of the install project, there should be a field in your major upgrade entries to specify a property to set when detecting an older version. You can then check this property to condition your Custom Action.
0 Kudos
Highlighted
Pilgrim

Re: Condition for Custom Action to run only on upgrade

Though less specific version-wise, when you are doing an upgrade, the IS_MAJOR_UPGRADE or IS_MINOR_UPGRADE property will be set. You probably want to use your upgrade view to specify the property to be set when a particular version of your software is being upgraded, as gbaltazar pointed out.
0 Kudos
Highlighted
Pilgrim

Re: Condition for Custom Action to run only on upgrade

Thank you. I used IS_MAJOR_UPGRADE and it appears to be working.
0 Kudos