【问题标题】:WIX upgrade only the version and not the installed filesWIX 只升级版本而不是安装的文件
【发布时间】:2016-08-05 15:08:36
【问题描述】:

我有一个安装程序,<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。

因此,所有全新安装脚本都会在补丁过程中再次执行。

下面是示例测试包,说明了我在说什么。

要求为 3.4.15 到 3.4.16 单独运行第 2 步,并为全新安装 3.4.16 运行第 1 步和第 2 步

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

谢谢

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

【问题讨论】:

    标签: wix wix3.8


    【解决方案1】:

    主要升级是卸载->安装。如果你想改变现有的安装,你应该使用补丁。

    【讨论】:

      猜你喜欢
      • 2017-12-27
      • 1970-01-01
      • 1970-01-01
      • 2016-01-15
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 2012-03-17
      • 1970-01-01
      相关资源
      最近更新 更多