简体   繁体   English

从WiX捆绑包安装,使用MSI升级会导致安装多个版本

[英]Install from WiX bundle, upgrade with MSI results in multiple versions installed

I have an application whose installer can be delivered in two forms: 我有一个应用程序,其安装程序可以两种形式提供:

  1. An MSI package; MSI软件包; and
  2. A WiX bundle containing the package along with some chained prerequisites. 一个WiX捆绑包,其中包含该软件包以及一些链接的必备组件。

Most users will opt to install the bundle, but I want to retain the possibility of manually installing the prerequisites and the MSI package. 大多数用户将选择安装捆绑软件,但我想保留手动安装必备组件和MSI软件包的可能性。

My automatic update process involves downloading a new MSI package and doing a major upgrade. 我的自动更新过程包括下载新的MSI软件包并进行重大升级。 This works perfectly as long as the application was originally installed using the MSI package. 只要最初使用MSI软件包安装该应用程序,它就可以完美运行。 However, if the application was installed from the bundle I end up with two versions installed side by side. 但是,如果从捆绑软件中安装了该应用程序,那么我最终会同时安装两个版本。

How can I make sure that an upgrade using a downloaded MSI correctly replaces or removes the original bundle? 如何确保使用下载的MSI进行的升级可以正确替换或删除原始捆绑包?


Bundle.wxs: Bundle.wxs:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Bundle Name="The Product" Version="!(bind.packageVersion.TheProduct.Msi)" Manufacturer="TheCompany" UpgradeCode="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
      <bal:WixStandardBootstrapperApplication
          LicenseFile="Resources\license.rtf"
          LogoFile="Resources\logo.png" />
    </BootstrapperApplicationRef>

    <Chain>
      <PackageGroupRef Id="NetFx451Web" />
      <MsiPackage Id="TheProduct.Msi" SourceFile="$(var.TheProduct.Msi.TargetPath)" Vital="yes" Compressed="yes" />
    </Chain>
  </Bundle>
</Wix>

Product.wxs (the MSI): Product.wxs(MSI):

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="TheProduct" Language="1033" Version="!(bind.fileVersion.TheProduct.dll)" Manufacturer="TheCompany" UpgradeCode="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />
    <UIRef Id="WixUI_Minimal" />
  </Product>
    <!-- ... snip ... -->
</Wix>

An .msi package cannot upgrade a bundle; .msi软件包无法升级捆绑软件; only another bundle can do that. 只有另一个捆绑软件可以做到。 But an .msi package can upgrade an .msi package that was originally installed by a bundle. 但是.msi软件包可以升级最初由捆绑软件安装的.msi软件包。 You're getting two entries in ARP, not two packages installed side-by-side. 您在ARP中获得了两个条目,而不是并排安装了两个软件包。 @Ravi's answer is correct: Use ARPSYSTEMCOMPONENT to ensure that the .msi package isn't visible, to match how the bundle installs it. ARPSYSTEMCOMPONENT的答案是正确的:使用ARPSYSTEMCOMPONENT确保.msi软件包不可见,以匹配捆绑软件的安装方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM