PDA

View Full Version : How to reference environment variable in response file?



kwood42
03-25-2003, 02:43 PM
I want to set the value of a property in a response file using the value of an environment variable.

I've searched the online manual, the KB, and the forums. If it's there, I can't find it...

Which, if any, of the following is correct in a response file.?

-P xyz.abc=$HOSTNAME
-P xyz.abc="$HOSTNAME"
-P xyz.abc=$E(HOSTNAME)
-P xyz.abc="$E(HOSTNAME)"

Or, do you do it from the command line?

installer -P xyz.abc="$HOSTNAME" -options /tmp/xyz.txt

If I use the -P on the command line, should the corresponding
entry NOT exist in the response file? Or, does the value on the command line override anything defined in the response file???

Thanks for your assistance.

Jeff Dillon
03-25-2003, 07:03 PM
> -P xyz.abc="$E(HOSTNAME)"

The above should work in a response file or on the command line. I just tested it and it worked fine for me.

kwood42
03-26-2003, 11:36 AM
Well, it didn't work for us. Perhaps it is because the parameters are -W parameters, the "$E(HOSTNAME)" results in literal $E(HOSTNAME) as value used in the installation. But, shouldn't
-P and -W treat $E() the same?

What we've found by trial and error is that we have to take the statements out of the response file and put them on the command line:

-W nodeNameBean.nodeName="$HOSTNAME" -W nodeNameBean.hostName="$FULLHOST"

This does not work with $E in the response file....

Jeff Dillon
03-26-2003, 11:56 PM
I tried it with $W and it worked for me. To prove it to yourself, add a text display panel to a project. Run the installer like...

java -jar setup.jar -W textDisplayPanelBeanId.text="$E(PATH)"

(Or you can do the above in a response file.)

You will see your PATH variable in a text display panel.

>-W nodeNameBean.nodeName="$HOSTNAME" -W nodeNameBean.hostName="$FULLHOST"

The reason that the above works is because the *shell* is resolving those variables before ISMP ever gets ahold of them.

kwood42
03-27-2003, 09:34 AM
Yes, I know why the command line approach works, because the shell expands the variables. That's why we had to do it from the command line.

We are installing IBM's WebSphere 5.0 Enterprise. We deduced it was using Installshield because the uninstall displays the Installshield name. The WebSphere manual comes with a sample response file which we are using.

I'll repeat what I said before. If we use "$E(VARIABLE)" in the
response file they provided, it does NOT work. We can tell it does not work because, in the installed application, rather than having, say, "box929.e2open.com" in the appropriate place, it has $E(FULLHOST).

Since this is not an installer I created, I cannot add a panel to test it. All I can do is document that it does not work as advertised. Was this a bug in an earlier version? Perhaps the version used by IBM is not 5.0?

Anyhow, we can use the command line approach and it works. Thanks for your assistance.

Jeff Dillon
03-27-2003, 10:12 AM
Yes, $E was introduced in ISMP 5.0. The WebSphere installer is almost certainly 4.5x, in which case $E was not yet available.

kwood42
03-27-2003, 11:12 AM
Thanks!!!