【发布时间】:2016-01-15 04:30:24
【问题描述】:
我有一个应用程序,它的安装程序可以以两种形式交付:
- 一个 MSI 包;和
- 包含软件包的 WiX 捆绑包以及一些链接的先决条件。
大多数用户会选择安装捆绑包,但我希望保留手动安装先决条件和 MSI 包的可能性。
我的自动更新过程包括下载新的 MSI 软件包并进行重大升级。只要该应用程序最初是使用 MSI 软件包安装的,它就可以完美运行。但是,如果应用程序是从捆绑包中安装的,我最终会并排安装两个版本。
如何确保使用下载的 MSI 进行的升级正确替换或删除了原始捆绑包?
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(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>
【问题讨论】:
标签: wix