【发布时间】: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