使用WIX安装升级产品

时间:2013-02-25 20:41:23

标签: xml wix installer wix3.6

下面是我为版本1和版本2设置的设置。但是当我安装MSI软件包进行升级时,弹出消息框并要求从添加/删除程序中删除以前版本的安装而不是自行删除旧版本自动安装较新版本。

请告知我们需要修改的任何设置。

以下版本1设置:

  <Product Id="*" Name="CBUDirectMSI" Language="1033" Version="1.0.0.0" Manufacturer="" UpgradeCode="5fa35d9d-5b5a-40f0-9607-e381e728a146">

        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>

        <Upgrade Id="5fa35d9d-5b5a-40f0-9607-e381e728a146">
          <UpgradeVersion Property="OLD_VERSION_FOUND" 
           Minimum="1.0.0.0" 
           Maximum="2.0.0.0" 
           IncludeMinimum="yes" 
           IncludeMaximum="no" 
           OnlyDetect="no" 
           IgnoreRemoveFailure="no" 
           MigrateFeatures="yes" 
           Language="1033" />
          <UpgradeVersion 
          Property="NEWER_VERSION_FOUND" 
          Minimum="2.0.0.0" 
          IncludeMinimum="no" 
          OnlyDetect="yes" 
          Language="1033" />
        </Upgrade>

        <Condition Message="A newer version of [ProductName] is already installed. Exiting installation.">

        </Condition>

        <InstallExecuteSequence>
          <InstallExecute Before="RemoveExistingProducts" />
          <RemoveExistingProducts Before="InstallFinalize" />
        </InstallExecuteSequence>
    </Product>

版本2设置

<Product Id="B55596A8-93E3-47EB-84C4-D7FE07D0CAF4" Name="CBUDirectMSI" Language="1033" Version="2.0.0.0" Manufacturer="" UpgradeCode="5fa35d9d-5b5a-40f0-9607-e381e728a146">

    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>


    <Upgrade Id="5fa35d9d-5b5a-40f0-9607-e381e728a146">
      <UpgradeVersion Property="OLD_VERSION_FOUND" 
       Minimum="1.0.0.0" 
       Maximum="2.0.0.0" 
       IncludeMinimum="yes" 
       IncludeMaximum="no" 
       OnlyDetect="no" 
       IgnoreRemoveFailure="no" 
       MigrateFeatures="yes" 
       Language="1033" />
      <UpgradeVersion 
      Property="NEWER_VERSION_FOUND" 
      Minimum="2.0.0.0" 
      IncludeMinimum="no" 
      OnlyDetect="yes" 
      Language="1033" />
    </Upgrade>

    <Condition Message="A newer version of [ProductName] is already installed. Exiting installation.">

    </Condition>

    <InstallExecuteSequence>
      <InstallExecute Before="RemoveExistingProducts" />
      <RemoveExistingProducts Before="InstallFinalize" />
    </InstallExecuteSequence>
</Product>

Wix Installer确实识别新版本,但不会删除旧版本并安装较新版本;并给出以下消息框“但我仍然收到错误消息框说”已经安装了该产品的另一个版本。无法继续安装此版本。要配置或删除此产品的现有版本,请使用“控制面板”上的“添加/删除程序”。

任何人都可以告诉我哪里出错了。

1 个答案:

答案 0 :(得分:1)

我建议您使用MajorUpgrade标记,而不是目前正在实施的Upgrade标记。 MajorUpgrade是一个更简单的使用过程。

<MajorUpgrade
    Schedule="afterInstallInitialize"
    DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit.">

示例摘自:http://wix.sourceforge.net/manual-wix3/major_upgrade.htm