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. – Paragraph3.0.4.0
->3.0.4.18
won't trigger major upgrade, but3.0.4.18
->3.0.5.27
does. – ParagraphUpgradeCode
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. – Paragraphv3.0.4.0
andv3.0.4.18
? – Paragraphmsiexec -i setup.msi -l*v log.txt
. Look for log entries aroundAppSearch
andPREVIOUSVERSIONSINSTALLED
. YourUpgrade
element should work, although you are also replacing newer versions instead of showing a message that a newer version is already installed. Allowing downgrades is bad practice (code from this answer would be better) unless you have very good reasons to do so. – ParagraphRemoveExistingProducts
action, which "removes the products in sequence by invoking concurrent installations". Look into the verbose log to see what is preventing the installer from doing that. – ParagraphMessage
FROMError
WHEREError
= 1709 MSI (s) (20:04) [12:54:00:123]: Product: AppName (v3.0.5.30) -- A newer version of this software is already installed. – Vanpelt