【问题标题】:Update MSI package via Wix bootstrapper通过 Wix 引导程序更新 MSI 包
【发布时间】:2015-03-08 00:36:15
【问题描述】:

我有 wix bootstapper,其中包括 4 个组件:tree exe 包和一个 msi 包。我想使用下面的引导程序对 msi 包进行重大更新(仅主要代码):

<Bundle Name="$(var.Name)" Version="$(var.Version)" Manufacturer="$(var.Manufacture)" UpgradeCode="$(var.UpgradCode)" Copyright="$(var.Copyright)">
....
<Chain>
      <!-- TODO: Define the list of chained packages. -->
      <PackageGroupRef Id="NetFx4Full"/>
      <PackageGroupRef Id="PostgreSQL"/>
      <PackageGroupRef Id="AdobeReader"/>
      <PackageGroupRef Id="Application"/>
</Chain>
....
<PackageGroup Id="Application">
  <MsiPackage Id="MyApplication"
              SourceFile=".\MSI_File\application.msi"
              DisplayInternalUI="yes"
              Permanent="no"
              Vital="yes"
              Visible="no"/>
others packages...
</PackageGroup>

和msi代码:

<Product Id="*"
    Name="$(var.Name)"
    Language="$(var.InstallerLanguage)"
    Version="$(var.Version)"
    UpgradeCode="$(var.UpgradeCode)"
    Manufacturer="$(var.Manufacture)">

<Package Description="$(var.PackageDescritpion)"
        InstallerVersion="200"
        Compressed="yes"
        InstallScope="perMachine"
        InstallPrivileges="elevated"
        Platform="x64"/>

<Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>


<Directory Id="TARGETDIR" Name="SourceDir">
</Directory>

<Feature Id="Complete"
             Level="1"
             ConfigurableDirectory="INSTALLDIR">
  <ComponentRef Id="Licence"/>
  <ComponentRef Id="StartMenuFoldersComponent"/>
  <ComponentRef Id="DatabaseConfigFolder"/>
  <ComponentGroupRef Id="BinaryFileGroup"/>
  <ComponentGroupRef Id="DatabaseConfigFileGroup"/>
  <ComponentRef Id="ApplicationConfigFolder"/>
  <ComponentRef Id="RemoveFolderOnUninstall"/>
</Feature>

<!-- Custom actions-->
.....

<InstallExecuteSequence>
  <RemoveExistingProducts After="InstallValidate"/>
  <!--Other custom actions-->
  ......
</InstallExecuteSequence>

为了构建我的更新 msi 和 bootstrap,我设置了更大的(msi 和 bootstrap 相同)产品版本,例如旧版本有 1.0.0.0,新版本有 1.0.1.0。 WIX 文档中所说的升级代码保持不变。运行我的更新安装程序后,新版本的 msi 未安装,安装目录中仍然是旧文件。有谁知道我做错了什么?

@编辑 我还尝试添加 MajorUpgrade 元素,但之后引导程序无法启动 MSI:

<Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>
<MajorUpgrade  Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of     [ProductName] is already installed. Setup will now exit."/>
<Directory Id="TARGETDIR" Name="SourceDir"/>

@编辑 引导程序日志:http://wklej.to/Msczq

【问题讨论】:

    标签: wix windows-installer


    【解决方案1】:

    您需要将升级信息添加到 .msi 包中。有关MajorUpgrade element 的使用,请参阅http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html。

    【讨论】:

    • 按照文档说明添加 MajorUpgrade 元素后,引导程序无法运行我的 MSI :/.
    • 检查刻录日志以确定刻录为您的 .msi 包计划的内容。
    • 来自日志:计划包:应用程序,状态:过时,默认请求:无,ba 请求:无,执行:无,回滚:无,缓存:否,取消缓存:否,依赖项:无。看起来引导程序认识到要安装的包比已经安装的包旧。但我确信设置的版本号比已经安装的要大。我还在我的问题中添加了刻录日志。有人知道吗?
    • 日志显示每个用户相关的包。您无法使用每台机器的软件包升级它。它们需要具有相同的范围。
    • 已解决。问题出在我测试安装程序的操作系统中。以前的安装程序版本可能有很多垃圾。无论如何,谢谢你的帮助:)
    猜你喜欢
    • 2015-01-13
    • 1970-01-01
    • 2013-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多