2013-05-16 181 views
2

我有两个MSI; framework.msiproduct.msiframework.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.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引用了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引导程序做什么?

回答

3

今天烧伤是不可能的。链条是固定的。在安装时,它通过向前运行,在卸载时向后运行。我能想到的两种选择可利用的今天:

  1. 不要有MSI的升级相互让当新的软件包卸载旧的包老的MSI被删除。

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

一种功能要求可能是有新的软件包必须安装后之前删除旧的包而不是今天像它的能力,但不是在这个时间点支持。