Page 1 of 1

Pass variable to applicaiton

Posted: Mon Feb 23, 2009 7:52 pm
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 ""

Posted: Mon Feb 23, 2009 8:45 pm
by MichaelNesmith
"VARIABLE=LONG VALUE"

Posted: Tue Feb 24, 2009 12:38 am
by pointos
I'm not folllowing, do I do this:

Run Program $COMMONFILES$\\PointOS\\reg.exe failed "$TEST$=LONG VALUE" "Main Error"

Posted: Tue Feb 24, 2009 4:13 am
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"

Posted: Tue Feb 24, 2009 1:15 pm
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"

Posted: Tue Feb 24, 2009 1:30 pm
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...