Under "Add or remove programs" i can see five versions:
- ApplicationName v3.0.4.0
- ApplicationName v3.0.4.18
- ApplicationName v3.0.5.27
- ApplicationName v3.0.5.28
- ApplicationName v3.0.5.29
when trying to install ApplicationName v3.0.5.30 all previous versions are NOT deleted. Versions that stays are:
- ApplicationName v3.0.4.0
- ApplicationName v3.0.4.18
I already read all about on How to implement WiX installer upgrade?
Code that i use is:
<Product Id="*"
UpgradeCode="$(var.UpgradeCode)"
Version="$(var.Version)"
Language="1033"
Name="$(var.ProductDisplayName) (v$(var.Version))"
Manufacturer="Unknown">
<Package InstallerVersion="380" Compressed="yes"/>
<Media Id="1" Cabinet="IileServer.cab" EmbedCab="yes" />
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion
Minimum="0.0.0.0" Maximum="99.0.0.0"
Property="PREVIOUSVERSIONSINSTALLED"
IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
What i am doing wrong?
I also tryed to build version v3.0.6.0 and after install i got the same result.
Versions v3.0.5.X was removed
Versions v3.0.4.X was not uninstalled
UpgradeCode is the same for all versions, i looked with Orca image
Last UpgradeCode on image is for version 3.0.6.0
$(var.UpgradeCode)
stable between versions? Run the installation with verbose logging enabled (msiexec -i setup.msi -l*v log.txt
), to see ifPREVIOUSVERSIONSINSTALLED
gets set as you expect. – zett423.0.4.0
->3.0.4.18
won't trigger major upgrade, but3.0.4.18
->3.0.5.27
does. – zett42UpgradeCode
is the same for all versions. Most likely it was different for the v3.0.4.x series. If this is true, you have to add a 2ndUpgrade
element with theUpgradeCode
of v3.0.4.x. @SteinÅsmul gives some hints in his answer, how to find theUpgradeCode
of installed MSIs. You could also open a 3.0.4.x MSI file in Orca and copy theUpgradeCode
from theProperty
table. – zett42