我有两个 MSI;framework.msi
和product.msi
。将framework.msi
dll 安装到product.msi
安装和卸载所依赖的 GAC 中。
我创建了一个将两个 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
引用了一个CheckInstaller
不再在 GAC 中的程序集 ( ) 版本(因为它已作为升级的一部分进行了framework.msi
升级)。
无需编写自定义 BA,我希望能够执行以下操作:
// pseudo code
if(product.Exists() && framework.Exists())
{
product.Uninstall(); // product is dependent on the framework
framework.Uninstall();
}
framework.Install();
product.Install();
我意识到如果我们将两个 MSI 组合成一个大产品,这将是可能的,但由于我们将它们分散framework.msi
到其他团队并且出于各种其他原因,它们需要保持分开。
我想要做的甚至可以用 WiX 引导程序做吗?