3

我设置了 WIX 安装选项,升级以删除以前的 DLL,但是当我进入控制面板并转到添加/删除程序部分时,以前的版本仍然存在。

如何从此“添加/删除”部分中删除以前的图标?

......

回应下面的评论对不起,我仍然无法让它工作,当我升级时,以前的版本仍然显示在“添加/删除程序”部分,这是一些代码

我最初确实将 ID 设置为“*”,但现在我只是在进行下一个构建时更改产品 ID

<Upgrade Id="$(var.UpgradeCode)">
  <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
  <UpgradeVersion Minimum="1.0.0"
                  IncludeMinimum="yes"
                  OnlyDetect="no"
                  Maximum="$(var.ProductVersion)"
                  IncludeMaximum="no"
                  Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>
4

1 回答 1

0

您要升级的版本之间的升级 id 必须相同。如果要执行重大升级,是否删除了以前的安装,然后安装新版本,必须更改的属性是产品 ID

“*”会导致 WIX 生成新的 guid

你想要这样的东西:

<!--Product -->
<Product Id="*" Name="$(var.Product.Name)" Language="$(var.Product.Lang)" Version="$(var.Product.Version)" Manufacturer="$(var.Product.Manufacturer)" UpgradeCode="{Replace me with a constant Upgrade Guid}">
<Package InstallerVersion="$(var.Package.InstallerVersion)" Compressed="yes" Platform="$(var.Platform)" />   


   <!--Condition Messages-->
    <Condition Message="A newer version of $(var.Product.Name) is already installed. Exiting installation.">
      <![CDATA[Installed OR NOT NEWER_VERSION_FOUND]]>
    </Condition>

<!-- Upgrade Table -->
<Upgrade Id="{Replace me with a constant Upgrade Guid}">

  <UpgradeVersion
    Property="OLD_VERSION_FOUND"
    Minimum="0.0.0.0"
    Maximum="$(var.Product.Version)"
    IncludeMinimum="yes"
    IncludeMaximum="no"
    OnlyDetect="no"
    IgnoreRemoveFailure="yes"
    MigrateFeatures="yes"
    Language="1033"  />

  <UpgradeVersion
    Property="NEWER_VERSION_FOUND"
    Minimum="$(var.Product.Version)"
    IncludeMinimum="no"
    OnlyDetect="yes"
    Language="1033"  />

</Upgrade>

<!--Removes the old version and then installs the new version-->
<InstallExecuteSequence>
  <RemoveExistingProducts After="InstallInitialize"></RemoveExistingProducts>
  <InstallExecute After="RemoveExistingProducts"></InstallExecute>
</InstallExecuteSequence>

您还应该注意,您不能在每个用户和每个机器安装之间切换版本。

于 2012-03-22T21:57:24.903 回答