3

After an application is installed from a msi made with WiX :

  • If I run the same msi file it will go in maintenance mode and I can repair / uninstall.

  • If I run a msi that was rebuilt from source with Product Id="*" in the WiX source it will start a normal install and not detect it's already installed. If I go through the install it will be listed as installed 2 times (with same version number) in add/remove programs.

  • If I run a msi that was rebuilt from source with Product Id="my-own-guid" in the WiX source I get an error "Another version of this product is already installed. ..."

How can I build the exact same msi from what I have in source control? So that I don't have to keep the original msi file but just the source?

Sacha K
  • 602
  • 6
  • 22

2 Answers2

1

You can set <Package Id="YOUR_GUID"...> so that your MSI has the same PackageCode with each build.

jbudreau
  • 1,287
  • 1
  • 10
  • 22
  • @budreau I think you also need to change the `ProductVersion`. At least it seems to be true for `Wix 3.11.1`. Please see [this](https://stackoverflow.com/a/7803216/1232087) `SO` post. – nam Feb 03 '19 at 01:31
  • I believe the OP wants to re-build the MSI from source and have the same MSI output. So, they don't want anything to change... – jbudreau Feb 04 '19 at 02:29
1

By Setting product id and package id. Example:

< Product Id="{F8B72915-0441-43D5-BCBF-2D9B56D40BD0}" Name="$(var.Name)"
Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)" Version="$(var.Version)" Language="1033">

< Package Id="{D715660D-CE5B-4AFE-878B-ABD943DD20FD}" InstallerVersion="300" Compressed="yes"/>

Problem Explanation: If product id is set with “*” then product id will be auto generated and after every rebuilt, product id is being set with different id thats why its installing second time. If corresponding package id is not set with unique guid then you will get an error "Another version of this product is already installed. …"

Once you set both id with unique id then after every rebuilt product id and package id is set with the same id with previous version of msi installer, and when you will go to install the new built installer, it will ask you repair / uninstall.

Sopan Maiti
  • 189
  • 1
  • 11