Can you clarify what tools you use to create this installer?
I am using Windows Installer XML ( WIX ). On WIX, you can do something like this:
<?define SkuName = "MyCoolApp"?> <?define ProductName="My Cool Application"?> <?define Manufacturer="Acme Inc."?> <?define Copyright="Copyright Β© Acme Inc. All rights reserved."?> <?define ProductVersion="1.1.0.0"?> <?define RTMProductVersion="1.0.0.0" ?> <?define UpgradeCode="{EF9D543D-9BDA-47F9-A6B4-D1845A2EBD49}"?> <?define ProductCode="{27EA5747-9CE3-3F83-96C3-B2F5212CD1A6}"?> <?define Language="1033"?> <?define CodePage="1252"?> <?define InstallerVersion="200"?>
Define update options:
<Upgrade Id="$(var.UpgradeCode)"> <UpgradeVersion Minimum="$(var.ProductVersion)" IncludeMinimum="no" OnlyDetect="yes" Language="$(var.Language)" Property="NEWPRODUCTFOUND" /> <UpgradeVersion Minimum="$(var.RTMProductVersion)" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IgnoreRemoveFailure="no" IncludeMaximum="no" Language="$(var.Language)" Property="OLDIEFOUND" /> </Upgrade>
Then you can use the OLDIEFOUND and NEWPRODUCTFOUND , depending on what you want to do:
<CustomAction Id="ActivateProduct" Directory='MyCoolAppFolder' ExeCommand='"[MyCoolAppFolder]activateme.exe"' Return='asyncNoWait' Execute='deferred'/> <CustomAction Id="NoUpgrade4U" Error="A newer version of MyCoolApp is already installed."/>
The above actions must be defined in InstallExcecuteSequence
<InstallExecuteSequence> <Custom Action="NoUpgrade4U" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <Custom Action="ActivateProduct" OnExit='success'>NOT OLDIEFOUND</Custom> </InstallExecuteSequence>
Vivek source share