2

我有两个 MSI;framework.msiproduct.msi。将framework.msidll 安装到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.msiproduct.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 引导程序做吗?

4

1 回答 1

3

今天的 Burn 不可能做到这一点。链条是固定的。安装时向前运行,卸载时向后运行。我可以想到今天可用的两种选择:

  1. 不要让 MSI 互相升级,让旧 MSI 在新 Bundle 卸载旧 Bundle 时移除。

  2. 避免在包之间创建安装时依赖项。无论如何,这通常是一件好事。

一个功能请求可能是让新的 Bundle 能够在安装之前而不是像今天那样在安装之前删除旧的 Bundle,但目前还不支持

于 2013-05-16T22:29:47.370 回答