title: How to install features depending on the value of property
body: <p>I have a registry key that can be equal to one of two values: <em>special value</em> or <em>null</em>. And two features. </p>
  
  <p>When my registry key equals to <em>special value</em> the installer has to install first feature. if registry key is not found by registry search the installer has to install second feature. And if registry key has <em>null</em> value the installer must not install any of these two features. </p>
  
  <p>What I'm doing or understanding wrong? If INSTALLLEVEL=5, SPECIALVALUE="special",MYTREAT="1" the first feature must be installed,but the installer doesn't install both of the features in this case.</p>
  
  <pre><code>&lt;Feature Id="MyFeatures" Level="1" ConfigurableDirectory='INSTALLLOCATION' Display='expand' AllowAdvertise='no'&gt;
  
    &lt;ComponentRef Id='Empty'/&gt;
  
    &lt;Feature Id='First' Level='3' AllowAdvertise='no' ConfigurableDirectory='INSTALLLOCATION'&gt;
      &lt;Condition Level="0"&gt;INSTALLLEVEL=4 OR (MYTREAT="1" AND NOT SPECIALVALUE AND NOT SPECIALVALUE="")&lt;/Condition&gt;
      &lt;Condition Level="1"&gt;SPECIALVALUE="special" AND MYTREAT="1"&lt;/Condition&gt;
      &lt;ComponentRef Id="first_comp"/&gt;                 
    &lt;/Feature&gt;
  
    &lt;Feature Id="Second" Level="4" AllowAdvertise="no" ConfigurableDirectory="INSTALLLOCATION"&gt;
      &lt;Condition Level="0"&gt;INSTALLLEVEL=3 OR (MYTREAT="1" AND SPECIALVALUE)&lt;/Condition&gt;
      &lt;ComponentRef Id="second_comp"/&gt;
    &lt;/Feature&gt;
  
  &lt;/Feature&gt;
  </code></pre>
  
  <p>I had modified my code, but it's still not working right. Problem with conditions. There is a special value in registry key, but the installer is still skipping first feature. I had found that condition with just "MYTREAT=1" is not working. But in logs the client side is sending MYTREAT property with this value to the server.. INSTALLLEVEL is 1. MYTREAT  property is initialized with pushbutton control,may be here is my trouble? Here new code:</p>
  
  <pre><code>     &lt;Feature Id="Myfeatures" Level="3"
              ConfigurableDirectory='INSTALLLOCATION'
              Display='expand' AllowAdvertise='no'&gt;
                  &lt;Condition Level='1'&gt;MYTREAT="1"&lt;/Condition&gt;
                  &lt;ComponentRef Id='Empty'/&gt;
                  &lt;Feature Id='First' Level='3' AllowAdvertise='no'
                      ConfigurableDirectory='INSTALLLOCATION'&gt; &lt;!--Must be installed by default,default value of INSTALLLEVEL is 3--&gt;
                          &lt;Condition Level="1"&gt;MYTREAT="1" AND SPECIALVALUE="SPECIAL"&lt;/Condition&gt;
                          &lt;ComponentRef Id="first_comp"/&gt;                 
                  &lt;/Feature&gt;
                  &lt;Feature Id="Second" Level="10" AllowAdvertise="no"
                      ConfigurableDirectory="INSTALLLOCATION"&gt;&lt;!----&gt;
                              &lt;Condition Level="1"&gt;(MYTREAT="1" AND NOT SPECIALVALUE)&lt;/Condition&gt;
                              &lt;ComponentRef Id="second_comp"/&gt;                    
                  &lt;/Feature&gt;
          &lt;/Feature&gt;
  
                       ............
  &lt;Dialog Id="TreatDlg" Width="260" Height="85"&gt;    
  &lt;Control Id="Mytreat" Type="PushButton" X="50" Y="57" Width="56" Height="17" Property="MYTREAT"&gt;
         &lt;Publish Property="MYTREAT" Value="1"&gt;1&lt;/Publish&gt;
         &lt;Publish Event="NewDialog" Value="VerifyReadyDlg"&gt;1&lt;/Publish&gt;
      &lt;/Control&gt;
  </code></pre>
  
  <p><strong>P.S.</strong> I initialized MYTREAT with 1 by default and condition was evaluated correctly. Why I cannot use control's property in feature's condition? And how to resolve my problem!Please any help! </p>