0
votes

I have a component that needs to be installed if another feature ( not the parent feature of the component) is being installed.

The component conditions seems to be evaulated during CostFinalize action, so i created a property and set the value of that property, I then force CostInitialize action using a custom action

but the component still doesnt get installed, any clues ?

1

1 Answers

0
votes

Component conditions are only evaluated for components that belong to features that are being installed. They can only exclude the component not include the component.

Install you must make the component belong to the other feature by using a ComponentRef element. Components are allowed to be associated with more then one feature.

<Directory....>
  <Component Id="test1"...>
  <Component Id="test2"...>
  <Component Id="testcommon"...>
</Directory>

<Feature Id="A"...>
  <ComponentRef Id="test1"/>
  <ComponentRef Id="testcommon"/>
</Feature>
<Feature Id="B"...>
  <ComponentRef Id="test2".../>
  <ComponentRef Id="testcommon".../>
</Feature>