1

I have created a new installer with a new version and Product ID with no errors but when it is installed, the current version remains installed as well as the updated version. I have been using this for a while to install and update my application on different machines but only recently has it started to not delete the old version completely. I have updated the .wxs file as follows:

1. Changed <Product Id="{F9030CA1-39AD-46BD-B2E2-3DBE02A8845B}".
2. Updated the new version number.

I have not updated the Upgrade Code. I have created multiple versions of the installer to see if the problem persist and it seems as it does. I have also updated the Wix extension to visual studio (Votive2019) but no luck. Not sure if there is a fault with my code or if this is a bug. I am not even sure what the cause of this problem is.

Below is a snippet of my code from the package section:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="{F9030CA1-39AD-46BD-B2E2-3DBE02A8845B}" Codepage="1252" Language="1033" Manufacturer="Mi-Plan" Name="FD to Excel" UpgradeCode="{17469B04-7B24-455E-BCB8-CD7AEA97CDCD}" Version="10.0.560">
        <Package Compressed="yes" Description="10.0.560.0" InstallerVersion="200" Languages="1033" Manufacturer="Jwayela Software" Platform="x86" />

Below is a snippet of my code from the upgrade section:

  <Upgrade Id="{A39F99F9-069F-4356-AA6A-5BBBC6DADB29}">
            <UpgradeVersion Maximum="10.0.560" Property="PREVIOUSVERSIONSINSTALLED" />
            <UpgradeVersion Minimum="10.0.560" Property="NEWERPRODUCTFOUND" OnlyDetect="yes" IncludeMinimum="yes" />
        </Upgrade>

I am using Visual Studio 2019.

Click here to get full file.

1 Answers1

0

Type Mismatch Error: It looks like there is a mismatch between the Upgrade element's "Id" value and the Upgrade Code you have specified in the Product element? That would explain why the major upgrade doesn't work, but not why it has worked so far?


Major Upgrade Element: Would recommend you use the simplified major upgrade element if you don't need fine grained control in the Upgrade table for something special. I just wrote an answer for this a few hours ago: Unable to remove previous versions of MSI. Multiple entry's show up in control panel. Magixal MajorUpgrade element - this single, simple line does all the work for you:

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

Define: Another thing is that Defines can be used to set values that are to be used in different places in the source and need to match exactly all the time:

<?define MyProductVersion = "31.00.0000" ?>
<?define MyProductCode = "PUT-GUID-HERE" ?>
<?define MyUpgradeCode = "PUT-GUID-HERE" ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product Id="$(var.MyProductCode)" Codepage="1252" Language="1033" Manufacturer="Corp"
           Name="Bla" UpgradeCode="$(var.MyUpgradeCode)" Version="$(var.MyProductVersion)">

   <...>

   <!-- Major upgrade -->
    <Upgrade Id="$(var.MyUpgradeCode)">

      <!-- Downgrade Protection -->
      <UpgradeVersion Minimum="$(var.MyProductVersion)" OnlyDetect="yes" 
                      IncludeMinimum="yes" Property="DOWNGRADE_DETECTED"  />

      <!-- Major Upgrade Configuration -->
      <UpgradeVersion IncludeMinimum="no" Maximum="$(var.MyProductVersion)" 
                      IncludeMaximum="no" MigrateFeatures="yes" Property="UPGRADE_DETECTED" />
    </Upgrade>

</Wix>
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Thank you so much. The product Upgrade Product Id and Upgrade Product Code were not the same and that was the issue. I will definitely give the Major Upgrade Element a shot and will implement the definitions to make life much easier for future upgrades. – Taahir Naidoo May 27 '19 at 06:59