PDA

View Full Version : Problem using a InstallAnywhere variable



macd81o0
12-14-2009, 12:55 PM
Using InstallAnywhere 8.0

I'm trying to use a IA variable coming from Get Password (Panel/Console). The variable is $USER_SUPPLIED_PASSWORD$. I try to use the variable in a script but I'm only get the value of "$".

Here is the script that I working with:

dbHost=`hostname`
dbName=rsdb
dbType=SYBASE
dbPort=4100
dbUser=sa
dbPass=$USER_SUPPLIED_PASSWORD$

echo $DBPASS$ > /opt/dbPass.txt

java -cp $NPSCLASSPATH nps/rdbms/db_version_level $dbHost $dbPort $dbName $dbUser $dbPass $dbType

After running the installer, I've checked dbPass.txt file and it only contains a "$". What am I doing wrong?

pv7721
12-14-2009, 01:08 PM
Would it be possible for you to post your project?

macd81o0
12-14-2009, 10:02 PM
Sorry, I can't post my project but I can send you parts of it. I could strip the project down to the script and the Password Panel if that would help.

pv7721
12-15-2009, 01:42 AM
Just a dummy project that would read the password and then the script would process it.

macd81o0
12-16-2009, 12:18 PM
Attached to this post is my project.

As you will see in the project, we are trying to see how to set the local script variable so that we can use it when we pass it into the java class.

The following part of the script works correctly because we use dbPass2 ,that was set correctly, in the java command parameters:

dbPass=`$USER_SUPPLIED_PASSWORD$`
echo $dbPass > /opt/dbPass.txt <<< incorrect value
echo $USER_SUPPLIED_PASSWORD$ > /opt/userPass.txt <<< correct value
dbPass2=`echo $USER_SUPPLIED_PASSWORD$`
echo $dbPass2 > /opt/dbPass2.txt <<< incorrect value
dbPass3="$USER_SUPPLIED_PASSWORD$"
echo $dbPass3 > /opt/dbPass3.txt <<< incorrect value

The odd thing is it doesn't work if we just use:

dbPass2=`echo $USER_SUPPLIED_PASSWORD$`
echo $dbPass2 > /opt/dbPass2.txt

Also we've tried to just use $USER_SUPPLIED_PASSWORD$ in the java command parameters.

It seems to us that there is a problem with using the IA variable directly