1

My installer has a Feature called "Tools"

What is installed by this feature is dependent on which version of SQL Server the client is running.

How can I have one feature with a condition that says "If SQL 2008 do ComponentGroupRef ID=SQL2008 otherwise ComponentGroupRef ID=SQL2012"

I'm creating 2 properties to hold the directory for SQL2008 and SQL2012, so those are the properties I'm using to make my determination.

This is close, but shows "Tools" feature twice.

<Feature Id="SQL2008Tools" Title="Tools" Level="1" Description="Installs all support UI Tools for SQL 2008">
      <Condition Level="1"><![CDATA[SQL2008BINDIR AND NOT SQL2012BINDIR]]></Condition>
      <ComponentGroupRef Id="Tools2008Component"/>
    </Feature>

    <Feature Id="SQL2012Tools" Title="Tools" Level="1" Description="Installs all support UI Tools for SQL 2012">
      <Condition Level="1"><![CDATA[SQL2012BINDIR]]></Condition>
      <ComponentGroupRef Id="Tools2012Component"/>
    </Feature>   

As always - thanks for any help!

Russ R
  • 61
  • 1
  • 7

1 Answers1

2

As you've found the title of a feature does not have to be unique. You have two features with the same title so it shows that way.

Try using nested features:

<Feature Id="SQLTools" Title="Tools" Level="1" Description="Installs support UI Tools for SQL Server"> 
  <Feature Id="SQL2008Tools" Title="SQL 2008 Tools" Level="1" Description="Installs all support UI Tools for SQL 2008">
    <Condition Level="1"><![CDATA[SQL2008BINDIR AND NOT SQL2012BINDIR]]></Condition>
    <ComponentGroupRef Id="Tools2008Component"/>
  </Feature>

  <Feature Id="SQL2012Tools" Title="SQL 2012 Tools" Level="1" Description="Installs all support UI Tools for SQL 2012">
    <Condition Level="1"><![CDATA[SQL2012BINDIR]]></Condition>
    <ComponentGroupRef Id="Tools2012Component"/>
  </Feature> 
</Feature> 
Tom Blodget
  • 20,260
  • 3
  • 39
  • 72
  • Well, when I do that, I get i main level called "Tools", with 2 child menu's, both saying "Tools". Locally, I have both SQL 2008 and SQL 2012, but my 1st condition does say "If SQL-2008 and not SQL-2012". – Russ R Sep 15 '14 at 12:02
  • 1
    Found answer. I have 2 features with title "Tools" and Level=0. The condition below sets the level to 1 (enabled) when true. – Russ R Sep 15 '14 at 12:07