WIX仅升级版本而不是已安装的文件

时间:2016-08-05 15:08:37

标签: wix wix3.8

我有<Product Id="GUID" Version="3.4.1.15"..的安装程序.. 安装程序将运行自定义操作分发给客户。

我正在尝试为msi创建更新/升级/补丁(版本= 3.4.1.16)。 新补丁应仅对新操作执行操作,这是3.4.16。

的一部分

以下是我尝试实现此目的的代码。 (已更改ProductId="*"并尝试AllowSameVersionUpgrades="yes"

安装程序进入主要升级模式,但安装程序正在执行以下序列。

  1. 删除第15版
  2. 将产品代码15升级为产品代码16
  3. 将产品16安装为全新安装。
  4. 因此,在修补过程中会再次执行所有新安装脚本。

    下面是示例测试包,说明了我们的意思。

    要求是单独运行步骤2以达到3.4.15至3.4.16&amp;运行步骤1&amp; 2,全新安装3.4.16

    我采取的步骤可能不正确。请帮助实现这一目标。

    由于

    <?xml version="1.0" encoding="UTF-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="WIXInstaller" Language="1033" Version="1.0.1.16" Manufacturer="ShoreTel" UpgradeCode="86c5a799-abe4-4949-a50c-f5aea92e5537">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    
        <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" />
        <MediaTemplate /> 
    
        <Feature Id="ProductFeature" Title="WIXInstaller" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
      <ComponentRef Id="base.ver" />
    </Feature> 
    </Product>
    
    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
        <Component Id="base.ver" DiskId="1" Guid="E1B7D00A-D6D8-4594-B4E1-E9AF67877132">
          <File Source="base.ver" KeyPath="yes" />
        </Component>
                <Directory Id="INSTALLFOLDER" Name="WIXInstaller" />
            </Directory>
        </Directory>
    </Fragment>
    
    <Fragment>
    <InstallExecuteSequence>
      <!-- SQLCMD commands preparation -->
      <Custom Action="fstInstall" After="InstallFiles">NOT Installed</Custom>
      <Custom Action="upgradeInstall" After="InstallFiles">UPGRADINGPRODUCTCODE</Custom>
      <Custom Action="remove" After="InstallFiles">REMOVE</Custom>
    
    
    </InstallExecuteSequence>
    <CustomAction Id="remove" Script="vbscript">
      <![CDATA[
    MsgBox("Remove 16")
    ]]>
    </CustomAction>
    <CustomAction Id="fstInstall" Script="vbscript">
          <![CDATA[
    MsgBox("First Install : 16")
    ]]>
    </CustomAction>
    <CustomAction Id="upgradeInstall" Script="vbscript">
      <![CDATA[
    MsgBox("Upgrade + Install : 16")
    ]]>
    </CustomAction>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
            <!-- <Component Id="ProductComponent"> -->
                <!-- TODO: Insert files, registry keys, and other resources here. -->
            <!-- </Component> -->
        </ComponentGroup>
    </Fragment>
    

1 个答案:

答案 0 :(得分:0)

主要升级是uninstall-&gt; install。如果要更改现有安装,则应使用patch。

相关问题