Wix Installer app won't install when run twice and uninstalls the app
Asked Answered
V

1

1

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." />
Virtual answered 12/11, 2019 at 13:31 Comment(6)
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 oneCoontie
@PavelAnikhouski The version is in defined in the project file. And this issue happens when I run the same version of the installer twice.Virtual
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 MajorUpgradeCoontie
@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} "Virtual
Can you share the complete wix code and error from log file? Usually this error happens when MSI package is brokenCoontie
@PavelAnikhouski The log file is 6MB large, because the installer recursively logs these message: "PROPERTY CHANGE: Adding MIGRATE property. Its value is '{58AD8C9B-D71E-4762-B25C-C231CCAE7C40}'." and "Disallowing uninstallation of component: {504EB49B-F2F0-58FD-AE06-66972EC9AF39} since another client exists"Virtual
M
2
<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:

Manful answered 12/11, 2019 at 15:45 Comment(2)
Thanks for your reply, I've gone through the links you shared, and they contain valuable information, but I couldn't find my solution.Virtual
But A temporary work arround was to change my upgrade code for evey new version of the installer.Virtual

© 2022 - 2024 — McMap. All rights reserved.