Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Feature dependencies in the Feature Selection Tree in Wix

Tags:

wix

wix3.9

Is there any way to force a particular feature to be installed if another feature is selected in the feature selection tree? That is without having the features be children of their dependencies?

like image 627
DeCaf Avatar asked Jan 27 '15 13:01

DeCaf


1 Answers

Yes this should be possible, if you use the Condition element under a Feature element, you can control the feature install level from a condition.

    <Feature Id="MyDependentFeature">
      <Condition Level="1">(NOT INSTALLED AND &MyMasterFeature=3) OR (INSTALLED AND !MyMasterFeature=3)</Condition> 
    </Feature>

    <Feature Id="MyMasterFeature"> 
    </Feature>

A couple things to explain here:

  • Condition Level="1" tells Wix to set the parent Feature install level to 1 (Install) (Info)
  • (NOT INSTALLED AND &MyMasterFeature=3) If the product is not already installed, and the requested action of MyMasterFeature is Install
  • (INSTALLED AND !MyMasterFeature=3) If the product is already installed, and the install state of MyMasterFeature is Installed. (Info)
like image 135
abbottdev Avatar answered Sep 29 '22 08:09

abbottdev