Conditionally install feature not working in Wix

Posted by Damien on Stack Overflow See other posts from Stack Overflow or by Damien
Published on 2010-06-16T02:58:41Z Indexed on 2010/06/16 3:02 UTC
Read the original article Hit count: 485

Filed under:
|
|

Hi, I have a setup which I need to support on IIS6 and IIS7. For now Im using the built in IIS extensions for IIS6 like so:

            <Component Id="C_IISApplication" Guid="{9099909C-B770-4df2-BE08-E069A718B938}" >                    
                <iis:WebSite Id='TSIWSWebSite' Description='TSWeb' SiteId='*' Directory='INSTALLDIR'>                        
                    <iis:WebAddress Id='tcpAddress' Port='8081' />
                </iis:WebSite>
                <iis:WebAppPool Id="BlahWSApplicationPool" Name="Blah" />
                <iis:WebVirtualDir Id="VirtualDir"
                                   Alias="Blah"
                                   Directory="INSTALLDIR"
                                   WebSite="BlahWSWebSite"
                                   DirProperties="WebVirtualDirProperties">

                    <iis:WebApplication Id="WebApplication"
                                        Name="Blah"
                                        WebAppPool="BlahWSApplicationPool"/>

                </iis:WebVirtualDir>
            </Component>

I have tried a condition in the features like so:

<Feature Title="IIS6" Id="IIS6" Description="IIS6" ConfigurableDirectory="INSTALLDIR" Level="1" Absent="disallow" Display="hidden">
        <ComponentRef Id="C_IISApplication" />
        <Condition Level="0"><![CDATA[IISVERSION <> '#6']]></Condition>
    </Feature>

No matter what the value of my condition, the metabase stuff gets executed and I get an error on IIS7 systems.

I have also tried putting the condition in the component and that didnt work either.

Is there something wrong with my usage?

© Stack Overflow or respective owner

Related posts about iis

Related posts about wix