Escaping a dollar sign ($)

Got a problem you cannot solve? Try here.
Post Reply
tltaylor76
Posts: 76
Joined: Mon Nov 06, 2006 2:07 pm
Location: Texas
Contact:

Escaping a dollar sign ($)

Post by tltaylor76 »

Is there a way to include a dollar sign in a variable name without causing the installer to die? I have tried putting a dollar sign in a variable and then using that variable and it still does not work...at run-time anyway. It does work when you go through the debugger.

We are installing different instances of a service, and to stay within the standards set by Microsoft, we would like to place a $ between the name and the instance. The is the same approach Microsoft takes with SQL Server.

Any help you could provide would be great. Thanks.
Trent L. Taylor
Sr. Software Developer
StrataFrame Application Framework
www.strataframe.net
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Are you saying that having a $ sign as part of a variable's value causes problems? That should work, and that should cover your requirement.

You can also use a single $ as a string literal for the $ sign. There is no need for escapes.

Variables are substituted only when an actual variable has been defined matching the pattern $VAR$, any other usage of the $ sign is also allowed.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
tltaylor76
Posts: 76
Joined: Mon Nov 06, 2006 2:07 pm
Location: Texas
Contact:

Post by tltaylor76 »

The problem I am running into is this...I am setting a service name according to the instance of the installation. I would like my resulting name to look like this:

MYSERVER$MYINSTANCE

So when I set the name inside of the editor in InstallAware, I have it set like this:

MYSERVER$$INSTANCENAME$

Which didn't work. So I tried to create a variable to substitue the literal character:

Set Variable DOLLARSIGN to $

MYSERVER$DOLLARSIGN$$INSTANCENAME$

This compiles, but when you run the installation at run-time, it never gets through the initial loading sequence. It will work through a debug session though.
Trent L. Taylor
Sr. Software Developer
StrataFrame Application Framework
www.strataframe.net
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

What happened with MYSERVER$$INSTANCENAME$?
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply