Pass variable to applicaiton

Got a problem you cannot solve? Try here.
Post Reply
pointos
Posts: 11
Joined: Mon Feb 23, 2009 7:40 pm
Location: USA
Contact:

Pass variable to applicaiton

Post by pointos »

I am trying to pass a variable as a parameter to an application from the installer.

reg.exe failed $SOMEVARIABLE$ "Error"

However, if the variable has spaces it needs to have quotes, but when I quote it it isn't passed as a variable.

Example:
If $SOMEVARIABLE$ = Hi How Are You

reg.exe failed $SOMEVARIABLE$ "Error"
passes Hi as the parameter in the 2nd spot, and How in the 3rd, etc.

reg.exe failed "$SOMEVARIABLE$" "Error"
passes $SOMEVARIABLE$ as parameter 2.

I want to have the value of $SOMEVARIABLE$ wrapped in ""
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

"VARIABLE=LONG VALUE"
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
pointos
Posts: 11
Joined: Mon Feb 23, 2009 7:40 pm
Location: USA
Contact:

Post by pointos »

I'm not folllowing, do I do this:

Run Program $COMMONFILES$\\PointOS\\reg.exe failed "$TEST$=LONG VALUE" "Main Error"
eugen.cocalea
Posts: 15
Joined: Tue Feb 17, 2009 12:54 pm

Post by eugen.cocalea »

pointos wrote:I'm not folllowing, do I do this:

Run Program $COMMONFILES$\\PointOS\\reg.exe failed "$TEST$=LONG VALUE" "Main Error"
Correct me if I'm wrong, but that should be

Run Program $COMMONFILES$\\PointOS\\reg.exe failed "TEST=LONG VALUE" "Main Error"
pointos
Posts: 11
Joined: Mon Feb 23, 2009 7:40 pm
Location: USA
Contact:

Post by pointos »

So in that example if my variable is COMPANYINFO

It will take the value of the installaware variable COMPANYINFO and pass it? I thought the compiler needed everything in $$ to recognize it as a variable?


Run Program $COMMONFILES$\\PointOS\\reg.exe failed "COMPANYINFO =LONG VALUE" "Main Error"
pointos
Posts: 11
Joined: Mon Feb 23, 2009 7:40 pm
Location: USA
Contact:

Post by pointos »

That didn't work it passed the value of

COMPANYINFO =LONG VALUE

I need it to pass the value of variable COMPANYINFO except in quotes.

If COMPANYINFO = The Bar

Then I want to pass (without varibles)

Run Program $COMMONFILES$\\PointOS\\reg.exe failed "The Bar" "Main Error"

I thought this would work, but it doesn't
Run Program $COMMONFILES$\\PointOS\\reg.exe failed "$COMPANYINFO$" "Main Error"

Am I doing something wrong? Is there a way to wrap the variable in quotes before I pass it?

Something like:

COINFO = " '+$COMPANYNAME$+' "

Then
Run Program $COMMONFILES$\\PointOS\\reg.exe failed $COMPANYINFO$ "Main Error"

Don't know how to do it, thanks for your help...
Post Reply