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.
<Property Id="USERNAME" Value="local"/>
<?define uName = [USERNAME]?>
<?if $(var.uName) = local ?>
<Condition Message="$(var.uName)">0</Condition>
<?endif?>
But, if I change the code to the following it will give the message.
<?define uName = local?>
<?if $(var.uName) = local ?>
<Condition Message="$(var.uName)">0</Condition>
<?endif?>
And the following code assigns the value of the USERNAME property to the uName
variable.
<Property Id="USERNAME" Value="local"/>
<?define uName = [USERNAME]?>
<Condition Message="$(var.uName)">0</Condition>
The above code prints 'local' in a message box.
I tried many scenarios and could locate where the problem is. When comparing variable values, which is assigned as,
<?define uName = [USERNAME]?>
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?