PDA

View Full Version : Detecting an upgrade in InstallScript MSI project



another_1
12-07-2009, 10:12 PM
Hello,
Is there a way in InstallScript to perform a certain action only if running an upgrade - does not matter, minor or major?
Using MAINTENANCE does not work for minor upgrades. !REMOVEALLMODE does not work because it includes a First install.
I can figure out how to do it using CA, but I prefer to use InstallScript.

Thank you,
MY

Alpesh
12-07-2009, 10:15 PM
Hi,

You can use these properties -- IS_MINOR_UPGRADE gets set for a minor upgrade and IS_MAJOR_UPGRADE gets set for a major upgrade.

Thanks,
Alpesh

another_1
12-07-2009, 10:22 PM
Hi,

You can use these properties -- IS_MINOR_UPGRADE gets set for a minor upgrade and IS_MAJOR_UPGRADE gets set for a major upgrade.

Thanks,
Alpesh
Right, but those are MSI properties, and I do not want to use those - we may later on switch to purely InstallScript, and this function will have to be re-written. Any suggestion for pure InstallScript? This is to be performed in "OnEnd" function.

Alpesh
12-07-2009, 11:28 PM
In that case, check the documentation of VerProductCompareVersions method and see if that helps.

another_1
12-08-2009, 02:59 PM
Thank you!
And how about the "First Install" condition? Can this be checked without using a function to compare versions?