我有以下代码:
<Feature Id='SMSGatewayFeatures' Title='SMS Gateway Product Feature' Level='2'>
<Condition Level='1'>INSTALLSMSGATEWAYSERVICE</Condition>
<ComponentGroupRef Id='group_SMSGATEWAYWSWEBAPPFILES' />
</Feature>
假设INSTALLLEVEL为1,我注意到当我将INSTALLSMSGATEWAYSERVICE设置为1时,将评估上述条件。此外,安装程序将正确设置此功能的安装级别为1
但是存在一个问题:虽然此功能的安装级别设置为1,但是没有安装group_SMSGATEWAYWSWEBAPPFILES的组件。发生了什么事?
不确定是否重要,但这里是片段的设置方式:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="group_SMSGATEWAYWSWEBAPPFILES">
<ComponentRef Id="comp_SMSGATEWAYWSWEBAPPFILES_0" />
<ComponentRef Id="comp_SMSGATEWAYWSWEBAPPFILES_1" />
...
</ComponentGroup>
<DirectoryRef Id="WEBDIR">
<Directory Id="dir_SMSGatewayWS_0" Name="SMSGatewayWS">
<Component Id="comp_SMSGATEWAYWSWEBAPPFILES_0" DiskId="1" KeyPath="yes" Guid="38B3FC5F-B556-40C1-BF8F-5EF41E29B345">
<File Id="file_SMSGATEWAYWSWEBAPPFILES_0" Source="D:\somepath\mssccprj.scc" />
</Component>
<Component Id="comp_SMSGATEWAYWSWEBAPPFILES_1" DiskId="1" KeyPath="yes" Guid="3C0B8CE2-1973-424D-868A-C2C074F254S3">
<File Id="file_SMSGATEWAYWSWEBAPPFILES_1" Source="D:\somepath\Service1.asmx" />
</Component>
...
</Directory>
</DirectoryRef>
</Fragment>
</Wix>