我有两个MSI; framework.msi
和product.msi
。 framework.msi
将dll安装到GAC中,product.msi
依赖于安装和卸载。Wix刻录升级需要在升级前卸载两个MSI's
我创建了一个将两个MSI连接在一起的BA。
<Bundle ...>
<Chain>
<PackageGroupRef Id='framework'/>
<PackageGroupRef Id='product'/>
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="framework">
<MsiPackage Name="Product Framework"
ForcePerMachine="yes"
SourceFile="framework.msi"
Vital="yes"
Cache="no"
Permanent="no"
Compressed="yes"
Visible="yes"/>
</PackageGroup>
<PackageGroup Id="product">
<MsiPackage Name="Product"
ForcePerMachine="yes"
SourceFile="product.msi"
Vital="yes"
Cache="no"
Permanent="no"
Compressed="yes"
Visible="yes"/>
</PackageGroup>
</Fragment>
对于全新安装,我framework.msi
和product.msi
正确安装。当我升级到新版本时,它会成功升级framework.msi
。然后,它继续卸载product.msi
,但它失败(对于此错误:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CheckInstaller, Version=1.0.0.0' or one of its dependencies. The system cannot find the file specified.
),因为卸载程序CustomAction
引用了GAC中不再存在的程序集版本(CheckInstaller
)(因为它已升级为framework.msi
升级的一部分) 。
而不必编写自定义BA,我希望能够做这样的事情:
// pseudo code
if(product.Exists() && framework.Exists())
{
product.Uninstall(); // product is dependent on the framework
framework.Uninstall();
}
framework.Install();
product.Install();
我意识到这将是可能的,如果我们两个微星的合并成一个大的产品,但由于我们将framework.msi
分散给其他团队,由于各种其他原因,他们需要保持分开。
我想甚至可以用WiX引导程序做什么?