Operating System - HP-UX
1829992 Members
3053 Online
109998 Solutions
New Discussion

Software Distributor - preinstall

 

Software Distributor - preinstall

Hi,

we packaging a product (so we build the depot).However, we need to change the SW_LOCATION at install time. so i tried

swinstall -s -x allow_multiple_versions=true ,l=

this works well, however if there is no location specified we need to assign a default location.

can someone tell me how to change the SW_LOCATION from within a preinstall script(or any other script).

cheers,
bharat
3 REPLIES 3
Ivan Krastev
Honored Contributor

Re: Software Distributor - preinstall

See how to set variables - http://docs.hp.com/en/B2355-90154/ch11s03.html

regards,
ivan

Re: Software Distributor - preinstall

Hi ivan,

this document just lists the environmental variables, but it does not explain how to set these variables.

i tried this in my preinstall:
=========================================
#! /bin/sh
UTILS="/usr/lbin/sw/control_utils"
if [ ! -f $UTILS ]; then
fatal_error "Cannot find $UTILS"
fi
. $UTILS

if [ "${SW_LOCATION}" = "/" ]
then
SW_LOCATION="/MY/LOC/"
_R=${SW_LOCATION} export _R
fi
exit 0
=========================================

_R is not document anywhere, but I suspect _R refers to SW_ROOT_DIRECTORY.This does not work however.

cheers,
bharat
Bob E Campbell
Honored Contributor

Re: Software Distributor - preinstall

You cannot set these variables usefully in a script. The environment is not passed back to the parent (swagent). I am not sure what you mean by setting a default location. This is easily done in the PSF using the directory attribute (see sd(4)).

If your concern is that you do not want multiple versions to be installed in the same location you need to stop the session using a checkinstall script and inform the user that a value must be passed.