Ymir
Ymir

Reputation: 300

No uninstall on Wix major upgrade

Here's my code:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <?define ProductName = "MyApp"?>
  <?define ProductCode = "GUID_NO1"?>
  <?define UpgradeCode = "GUID_NO2"?>
  <?define ProductVersion = "1.0.0"?>

  <Product Id="$(var.ProductCode)"
           Name="$(var.ProductName)"
           Language="1033" 
           Version="$(var.ProductVersion)"
           Manufacturer="Me"
           UpgradeCode="$(var.UpgradeCode)">

    <Package Description="My desc" 
             InstallerVersion="300"
             Compressed="yes"
             InstallScope="perMachine" />

<MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />
    ...

I build, install and all goes fine. So I replace

  <?define ProductCode = "GUID_NO3"?>
  <?define UpgradeCode = "GUID_NO4"?>
  <?define ProductVersion = "1.0.1"?>

I build, install and in programs/features i found 2 MyApp, one in version 1.0.0 and one in verison 1.0.1. Of course I need the 1.0.0 to be removed.

Keeping the same guid for ProductCode will not work.

I'm using Wix 3.8.

Upvotes: 0

Views: 983

Answers (1)

Kinexus
Kinexus

Reputation: 12904

Make sure that the UpgradeCode remains the same and change the Id to *.

<Product Id="*" Name="Stub" Language="1033" Version="$(var.Version)" 
    Manufacturer="" UpgradeCode="FAFD7276-68F3-43AF-BEBF-8F175499A243">

Upvotes: 5

Related Questions