Could you do this without variables?
<Property Id="USERNAME" Value="local"/>
<Condition Message="The username is local, please enter a username for the installation to proceed">USERNAME = "local"</Condition>
This would be correct if the user entered the username, then the installation will continue, but if the user does not complete this, he will fail because the default value is local.
I am wondering how the username is entered. Is it through the command line or from the input dialog box?
If in a dialog box - I suggest having a dialog box with an error, and not interrupt the installation. Maybe I'm wrong, but just giving you options.
Hope this helps ... :)
EDIT:
To do what you want, just add a condition to your component that your service is in. You have two components:
<Component Id="ServiceOne" Guid='*' Directory="Directory"> //All your service tags etc <Condition><![CDATA[USERNAME = "local"]]></Condition> </Component> <Component Id="ServiceTwo" Guid='*' Directory="Directory"> //All your service tags etc <Condition><![CDATA[USERNAME <> "local"]]></Condition> </Component>
source share