Can you elaborate what kind of tools are you using to create this installer?
I use Windows Installer XML(WIX). In WIX you could do something like this:
<!-- Property definitions -->
<?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"?>
And define upgrade 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 further you could use OLDIEFOUND
and NEWPRODUCTFOUND
properties depending on what you want to do:
<!-- Define custom actions -->
<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 defined actions have to be define in InstallExcecuteSequence
<InstallExecuteSequence>
<Custom Action="NoUpgrade4U"
After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
<Custom Action="ActivateProduct"
OnExit='success'>NOT OLDIEFOUND</Custom>
</InstallExecuteSequence>