title: Using if condition to compare variable values in WiX
body: <p>I want to check whether the user has passed an argument for USERNAME for which the default value is local. I am trying to see if I I get a message if the value is local. The problem is in the following way. This doesn't work.</p>
  
  <pre><code>&lt;Property Id="USERNAME" Value="local"/&gt;
  &lt;?define uName = [USERNAME]?&gt;
  
  &lt;?if $(var.uName) = local ?&gt;
        &lt;Condition Message="$(var.uName)"&gt;0&lt;/Condition&gt;
  &lt;?endif?&gt;
  </code></pre>
  
  <p>But, if I change the code to the following it will give the message.</p>
  
  <pre><code>&lt;?define uName = local?&gt;
  
  &lt;?if $(var.uName) = local ?&gt;
        &lt;Condition Message="$(var.uName)"&gt;0&lt;/Condition&gt;
  &lt;?endif?&gt;
  </code></pre>
  
  <p>And the following code assigns the value of the USERNAME property to the <code>uName</code> variable.</p>
  
  <pre><code>&lt;Property Id="USERNAME" Value="local"/&gt;
  &lt;?define uName = [USERNAME]?&gt;
  &lt;Condition Message="$(var.uName)"&gt;0&lt;/Condition&gt;
  </code></pre>
  
  <p>The above code prints 'local' in a message box.</p>
  
  <p>I tried many scenarios and could locate where the problem is. When comparing variable values, which is assigned as,</p>
  
  <pre><code>&lt;?define uName = [USERNAME]?&gt;
  </code></pre>
  
  <p>Though the value is assigned to uName, we can't do the comparison. Am I doing anything wrong here? Or is there another way for this kind of problem?</p>