1
votes

I wrote a simple wix installer with gui, which installs well. But when I run the same .msi file a second time, it takes me through the normal installation process in the gui, but uninstalls my app at the end. Then if I run this same .msi file a third time, the installer still does through the installation gui normally, but ends up doing "uninstallation".

I don't understand why it doesn't behave like every other installer and handle installation and uninstallation gracefully.

here is part of my product xml

 <Product Id="*" Language="1033" Codepage="1252" Name="..." 
       Version="$(var.ProductVersion)" Manufacturer="..." UpgradeCode="BDF9E310-5897-48D4-AB08-889D405F9X56">

<Package InstallerVersion="300" Platform="x64" Compressed="yes" InstallScope="perMachine" Manufacturer="..." 
         Comments="..." Description="..." Keywords="..."/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
1
What is value of var.ProductVersion? Also have you tried to check the msi log files? I guess, that removal is happens because msi detects a previous installation is old onePavel Anikhouski
@PavelAnikhouski The version is in defined in the project file. And this issue happens when I run the same version of the installer twice.Damien Doumer
MSI recognizes only first 3 digits in version, forth is omitted. If you want run the same version again and again, try to set AllowSameVersionUpgrades="yes" inside MajorUpgradePavel Anikhouski
@PavelAnikhouski yeah, thanks, I did that, but it causes an error and my installer bugs. when I check the log files I find that this error message is thrown repetitively : "Disallowing uninstallation of component: {8150336E-3...AC20CE771A88} "Damien Doumer
Can you share the complete wix code and error from log file? Usually this error happens when MSI package is brokenPavel Anikhouski

1 Answers

2
votes
<Product Id="*" Name="..."  Version="" Manufacturer="..." UpgradeCode="...">

Auto-GUID: The Id="*" section means "auto generate product code" (the use of the * means auto-generate). When you do that every build or rebuild of your setup gets a new product code. This amounts to a major upgrade in MSI-terms if you also change the ProductVersion (in one of the first 3 digits) AND you have a MajorUpgrade element such as the one you are using in the source (which is standard by the way).

Solution: You can hard code a product code if you like to be able to control when it changes.


Note: You might be in a dirty state on the system with many "overlapping" installations. Look for duplicate installations of your product by opening the Add / Remove Programs applet: WinKey + Tap R => appwiz.cpl => Enter. I would uninstall all instances, and maybe prefer to test setups on virtuals henceforth? (this also helps to discover hidden runtime depenencies - provided the virtual is saved without most runtimes).


Links: Some links with some background information on major upgrades.

MSI SDK:

Flexera / Installshield: