Since I cannot set conditions for elements in a component, I have to separate elements from two separate components with conditional ones. From each example how to do this:
<Component Id="IIS7Webhost" Guid="482EC8D7-2DA2-48e6-A11D-6CAB3C5973E8">
<Condition><![CDATA[IIS_MAJOR_VERSION >= "#7"]]></Condition>
<CreateFolder>
<Permission User="IUSR" GenericAll="yes"/>
</CreateFolder>
</Component>
<Component Id="IIS6Webhost" Guid="51C65FAC-84B7-43d1-A230-DD9AE66B5D99">
<Condition><![CDATA[IIS_MAJOR_VERSION <= "#6"]]></Condition>
<CreateFolder>
<Permission User="IUSR_[ComputerName]" GenericAll="yes"/>
</CreateFolder>
</Component>
But BOTH of these components are installed on each system and fail because there is only one of these users. What am I doing wrong here?
IIS_MAJOR_VERSIONcorrectly installed either on #6or #7. I also believe that I have the correct syntax because the start condition works correctly:
<Condition Message="Internet Information Services 5, 6, or 7 must be installed.">
<![CDATA[Installed OR (IIS_MAJOR_VERSION >= "#5" AND IIS_MAJOR_VERSION <= "#7")]]>
</Condition>
: , Windows ( ), . ? , .