【发布时间】:2015-01-31 14:16:14
【问题描述】:
我有一个网络应用程序,我想在 IIS 上安装它。这个应用程序支持插件架构。 它包括:
- 核心部分
- 插件A
- 插件B
我想要 2 个安装程序 (msi)。一个用于插件 A,另一个用于插件 B。 每个安装程序还应安装核心部分。因此,如果我为插件 A 运行安装程序,它应该安装核心部分和插件 A 二进制文件。然后,如果我为插件 B 运行安装程序,它应该只安装插件 B 二进制文件。但是如果首先运行插件 B 的安装程序,它应该安装核心部分和插件 B 二进制文件。
我将 WiX Merge Module 项目用于核心部分,并为每个安装程序创建了 2 个 WiX 项目。但它没有按我的意愿工作。
这就是它的工作原理:
- 我为插件 A 运行安装程序(工作正常)
- 我为插件 B 运行安装程序,它检测到产品已安装,显示删除、修复、更改页面
- 我选择更改,我在功能树上看到“插件 A”而不是“插件 B”
您可以在此处查看示例解决方案:https://github.com/bwojdyla/wixplugins 在调试配置中工作。蜡 3.9,VS2012
我的合并模块(核心部分):
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Module Id="CoreModule" Language="1033" Version="1.0.0.0">
<Package Id="751e70eb-cf76-413b-b8c8-231a31f9c946" Manufacturer="test" InstallerVersion="200" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLFOLDER" Name="PluginInstaller">
<Component Id="CoreComp" Guid="{161F78E1-0ABD-4FCD-92FC-6095A45F78B3}">
<File Id="CoreFile" KeyPath="yes" Source=".\Core.txt" />
</Component>
</Directory>
</Directory>
</Module>
</Wix>
插件 A:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="{8E93D1E7-C05F-40A0-B737-C053C1EE3E0A}" Name="PluginInstaller" Language="1033" Version="1.0.0.0" Manufacturer="test" UpgradeCode="eed33233-e773-45c2-87a1-ab349191a30a">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Id="{9C7D28B4-FBAD-4FE6-A204-8F6A11D89792}"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Media Id="1" Cabinet="Cab1.cab" EmbedCab="yes" />
<UIRef Id="WixUI_FeatureTree"/>
<FeatureRef Id="ProductFeature">
<Feature Id="PluginA" Title="Plugin A" Level="1" AllowAdvertise="no">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</FeatureRef>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="PluginInstaller" />
<Merge Id="CoreModule" Language="1033" SourceFile="..\CoreModule\bin\Debug\CoreModule.msm" DiskId="1" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="PluginAComp" Guid="{7641AF10-B2EF-4639-A0B4-34AE819CAD38}">
<File Id="PluginAFile" KeyPath="yes" Source=".\PluginA.txt" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
插件 B:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="{8E93D1E7-C05F-40A0-B737-C053C1EE3E0A}" Name="PluginInstaller" Language="1033" Version="1.0.0.0" Manufacturer="test" UpgradeCode="eed33233-e773-45c2-87a1-ab349191a30a">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Id="{9C7D28B4-FBAD-4FE6-A204-8F6A11D89792}"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Media Id="1" Cabinet="Cab1.cab" EmbedCab="yes" />
<UIRef Id="WixUI_FeatureTree"/>
<FeatureRef Id="ProductFeature">
<Feature Id="PluginB" Title="Plugin B" Level="1" AllowAdvertise="no">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</FeatureRef>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="PluginInstaller" />
<Merge Id="CoreModule" Language="1033" SourceFile="..\CoreModule\bin\Debug\CoreModule.msm" DiskId="1" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="PluginBComp" Guid="{D11704D9-9911-483A-B204-B2171DCB0E67}">
<File Id="PluginBFile" KeyPath="yes" Source=".\PluginB.txt" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
或者我应该使用其他 wix 功能来实现这一点?
【问题讨论】:
标签: wix windows-installer