我有兩個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引導程序做什麼?