更新应用程序时,Wix MSI 安装程序不会从 "Add/Remove Applications" 中删除以前的版本

Wix MSI installer is not removing previous version from "Add/Remove Applications" when updating the application

我已经使用新版本和产品 ID 创建了一个没有错误的新安装程序,但是在安装时,当前版本和更新版本仍然安装。我一直在使用它在不同的机器上安装和更新我的应用程序,但直到最近它才开始不完全删除旧版本。我已将 .wxs 文件更新如下:

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

我还没有更新升级代码。 我已经创建了多个版本的安装程序以查看问题是否仍然存在并且看起来确实如此。我还将 Wix 扩展更新为 visual studio (Votive2019),但没有成功。 不确定我的代码是否有错误或者这是一个错误。我什至不确定这个问题的原因是什么。

下面是我在包部分的代码片段:

<?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" />

下面是我在升级部分的代码片段:

  <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>

我正在使用 Visual Studio 2019.

单击 here 获取完整文件。

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:如果您不需要在升级中进行细粒度控制,建议您使用简化的主要升级元素table 一些特别的东西。几个小时前我刚刚为此写了一个答案:。 Magixal MajorUpgrade element - 这条简单的线为您完成所有工作:

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

Define: 另一件事是 Defines 可以用来设置要在源中的不同位置使用并且需要始终完全匹配的值:

<?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>