Unable to use variable in a service name


I have a situation in which I have some deploy targets part of a domain and others who aren’t. I’ve created a variable set to encapsulate the truthy values of IsDMZ and IsNotDMZ, scoped them, and created another variable of DMZAwareServiceUser which has no scope that looks like so:

#{if IsDMZ}userA#{/if}#{if IsNotDMZ}userB#{/if}

Per your documentation on variables, I thought this was fine and then tried to use #{DMZAwareServiceUser} in the user field for the windows service. However, deployment fails and this is in the error log:

sc.exe create "------" binPath= ------ depend= "/" start= "auto" obj= "#{DMZAwareServiceUser}" password= "************"

So, it is not getting evaluated and the message being logged is that the user does not exist or my password is wrong. How do I do this? I’m on version 3.3.14.


Apparently, I had this variable set included in every other project it was needed except this one. Works as expected.