title: Using a condition to make changes to the Windows firewall in WIX
body: <p>I am trying to make changes to the Windows firewall based on a property that is set in a dialog. I can see in the log that the property is being set correctly but the firewall rules are being created regardless of the value of the property.</p>
  
  <p>My code is...</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Component Id="ChangeFirewall" Guid="*" KeyPath="yes"&gt;
     &lt;Condition&gt;&lt;![CDATA[ChgFirewall = "True"]]&gt;&lt;/Condition&gt;
       &lt;fire:FirewallException Id="FW6501" Name="6501" Port="6501" 
                                           Protocol="tcp" Scope="any"/&gt;
       &lt;fire:FirewallException Id="FW6502" Name="6502" Port="6502" 
                                           Protocol="tcp" Scope="any"/&gt;
       &lt;fire:FirewallException Id="FW6505" Name="6505" Port="6505" 
                                           Protocol="tcp" Scope="any"/&gt;
  &lt;/Component&gt;
  </code></pre>
  
  <p>If ChgFirewall is False why does the firewall get changed?</p>
  
  <p><strong>Update:</strong> I have added the code for the dialog that sets the CHGFIREWALL property...</p>
  
  <pre><code>&lt;Dialog Id="FirewallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes"&gt;
      &lt;Control Id="Description" Type="Text" X="20" Y="20" Width="280" Height="40" Transparent="yes" NoPrefix="yes"&gt;
        &lt;Text&gt;This program uses TCP ports 6501, 6501, and 6505 for coordinating information between workstations. These ports must be unblocked for it to work correctly&lt;/Text&gt;
      &lt;/Control&gt;
      &lt;Control Id="Instructions" Type="Text" X="20" Y="70" Width="280" Height="30" Transparent="yes" NoPrefix="yes"&gt;
        &lt;Text&gt;This installer can attempt to automatically modify the Windows Firewall for you, or you may manually modify the firewall settings.&lt;/Text&gt;
      &lt;/Control&gt;
      &lt;Control Type="RadioButtonGroup" Property="CHGFIREWALL" Id="CHGFIREWALL" Width="340" Height="44" X="20" Y="120"&gt;
        &lt;RadioButtonGroup Property="CHGFIREWALL"&gt;
          &lt;RadioButton Text="Have the installer update the firewwall settings for Guru (Recommended)" Height="13" Value="True" Width="340" X="0" Y="0" /&gt;
          &lt;RadioButton Text="Manually update the firewall settings" Height="13" Value="False" Width="340" X="0" Y="15" /&gt;
        &lt;/RadioButtonGroup&gt;
      &lt;/Control&gt;
      &lt;Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next"&gt;
        &lt;Publish Event="EndDialog" Value="Return"&gt;&lt;/Publish&gt;
      &lt;/Control&gt;
      &lt;Control Id="CancelButton" Type="PushButton" Text="Cancel" Height="17" Width="56" X="180" Y="243" Cancel="yes"&gt;
        &lt;Publish Event="EndDialog" Value="Exit" /&gt;
      &lt;/Control&gt;
    &lt;/Dialog&gt;
  </code></pre>
  
  <p>Also this is my definition of the property...</p>
  
  <pre><code>&lt;Property Id='CHGFIREWALL' Value='False' Secure='yes'/&gt;
  </code></pre>