我试图让一个条件组件工作。
但是它根本不起作用,所以我很难过。
我有以下代码块:
该功能定义如下:
<Feature Id="MainFeature" Level="1" Title="!(loc.FEATURE.MAINFEATURE.TITLE)"
Description="!(loc.FEATURE.MAINFEATURE.DESCRIPTION)" Display="collapse">
<ComponentRef Id="MainExecutable" />
<ComponentRef Id="pmd" />
</Feature>
并且组件定义为
<Component Id="MainExecutable" Guid="*">
<Condition><![CDATA[(&MainFeature = 3) AND NOT (!MainFeature = 3)]]></Condition>
<File Id="MainExecutableFile" Name="SampleApp.exe"
Source="..\ProductBuild\sampleFile.txt" KeyPath="yes">
<Shortcut Id="MainExecutableStartMenu" Directory="ProgramMenuDir"
Name="!(loc.APPNAME)" WorkingDirectory="INSTALLDIR"
Icon="icon.ico" IconIndex="0" Advertise="yes"/>
<Shortcut Id="MainExecutableDesktop" Directory="DesktopFolder"
Name="!(loc.APPNAME)" WorkingDirectory="INSTALLDIR"
Icon="icon.ico" IconIndex="0" Advertise="yes" />
</File>
</Component>
但是这些文件永远不会安装!