#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
#
# The contents of this file are subject to the terms of either the GNU
# General Public License Version 2 only ("GPL") or the Common Development
# and Distribution License("CDDL") (collectively, the "License"). You
# may not use this file except in compliance with the License. You can
# obtain a copy of the License at
# or packager/legal/LICENSE.txt. See the License for the specific
# language governing permissions and limitations under the License.
#
# When distributing the software, include this License Header Notice in each
# file and include the License file at packager/legal/LICENSE.txt.
#
# GPL Classpath Exception:
# Oracle designates this particular file as subject to the "Classpath"
# exception as provided by Oracle in the GPL Version 2 section of the License
# file that accompanied this code.
#
# Modifications:
# If applicable, add the following below the License Header, with the fields
# enclosed by brackets [] replaced by your own identifying information:
# "Portions Copyright [year] [name of copyright owner]"
#
# Contributor(s):
# If you wish your version of this file to be governed by only the CDDL or
# only the GPL Version 2, indicate your decision by adding "[Contributor]
# elects to include this software in this distribution under the [CDDL or GPL
# Version 2] license." If you don't indicate a single choice of license, a
# recipient has the option to distribute your version of this file under
# either the CDDL, the GPL Version 2 or to extend the choice of license to
# its licensees as provided above. However, if you add GPL Version 2 code
# and therefore, elected the GPL Version 2 license, then the option applies
# only if the new code is made subject to such option by the copyright
# holder.
#
# Sun Install engine wrapper script
#
# binaries needed on both Solaris, Linux, etc.
PP_FAMILY="Unix"
PP_OSNAME="Solaris"
OS_ARCH="sparc"
# static constants
INSTALL_HOME=${MYDIR}/..
INSTALL_HOME=`cd ${INSTALL_HOME}; ${_PWD}`
# global settings
# user options
DEBUGLEVEL="INFO"
#-------------------------------------------------------------------------------
# usage only: define what parameters are available here
# input(s): exitCode
#-------------------------------------------------------------------------------
${CAT} <<EOF
Usage: $NAME [OPTION]
Options:
-a <path>, --answerfile=<path>
Supply a file containing install configuration. Can be used multiple times
for multiple answer files.
-n <file>, --dry-run=<file>:
Dry run mode. Do not install anything. Configuration answers written to <file>
-R <path>, --altroot=<path>
Operation with respect to an alternate root
-h, --help :
display this help list
-V, --version :
display version of install engine.
-l <level>, --level=<level>
Debug level. One of FATAL, WARNING, INFO, CONFIG, FINE, FINER, FINEST
-m <url>, --media-location=<url>
Specify location of metadata used to drive install. If blank,
assume no media.
-s <dir>, --configstate=<dir>
Directory where the config data is persisted as xcu files.
-i <path>, --installables=<path>
Root directory containing installable units for support of install and repair.
Private options:
-j <javahome>, --javahome=<javahome> :
use this java vm instead of searching for suitable one
-J <joptions>, --jvmoptions=<joptions> :
specify java vm options. For example -J "-verbose -Dhttp.proxy=foo.com:3434"
-C <classpaths>, --classpaths=<classpaths> :
specify a colon-separated list of additional classpaths
-c <file>, --config-file=<file> :
Specify extra properties in a file
-p <props>, --properties=<props> :
specify 1 or more config properties options, separated by comma,
to the install engine. For example:
--properties=Logs-Location=/tmp,Platform-Plugin-Path=c:\\Sun\\ppp
EOF
exit $1
}
#-------------------------------------------------------------------------------
# input(s): none
# output(s): instCode
#-------------------------------------------------------------------------------
theInstallEngine="${INSTALL_HOME}/lib/engine.jar:${INSTALL_HOME}/lib/sims.jar"
theInstallEngine="${theInstallEngine}:${INSTALL_HOME}/lib/config.jar"
theCP="${INSTALL_HOME}/lib/bootstrap.jar:${INSTALL_HOME}/lib/bindings.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/chaxml/chaxml.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/charva/charva.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/swixml/swixml.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/freemarker/freemarker.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/jaxb/jaxb-impl.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/jaxb/jaxb-jsr173_1.0_api.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/jaxb/jaxb-api.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/jaxb/activation.jar"
theCP="${theCP}:${INSTALL_HOME}/lib/external/apache/commons-logging.jar"
if [ -n "${ADDITIONALCLASSPATHS}" ]; then
theCP="${theCP}:${ADDITIONALCLASSPATHS}"
fi
if [ -n "${CLASSPATH}" ]; then
theCP="${theCP}:${CLASSPATH}"
fi
export JAVA_HOME
export CLASSPATH
export LD_LIBRARY_PATH
INSTALLPROPS="${INSTALLPROPS} -p Platform-Plugin-Path=${INSTALL_HOME}/lib/platforms"
INSTALLPROPS="${INSTALLPROPS} -p Provider-Path=${INSTALL_HOME}/lib/providers"
if [ -n "${DRYRUN}" ]; then
INSTALLPROPS="${INSTALLPROPS} -p Dry-Run-File=${DRYRUN}"
fi
if [ -n "${CONFIGSTATE}" ]; then
INSTALLPROPS="${INSTALLPROPS} -p Config-State=${CONFIGSTATE}"
fi
if [ -n "${ANSWERFILE}" ]; then
INSTALLPROPS="${INSTALLPROPS} -p Answer-Files=${ANSWERFILE}"
fi
if [ -n "${ALTROOT}" ]; then
INSTALLPROPS="${INSTALLPROPS} -p Alternate-Root=${ALTROOT}"
fi
if [ -n "${DEBUGLEVEL}" ]; then
INSTALLPROPS="${INSTALLPROPS} -p Log-Level=${DEBUGLEVEL}"
fi
if [ -n "${MEDIALOC}" ]; then
INSTALLPROPS="${INSTALLPROPS} -p Media-Location=${MEDIALOC}"
fi
if [ -n "${INSTALLABLES}" ]; then
INSTALLPROPS="${INSTALLPROPS} -p Installable-Unit-Path=${INSTALLABLES}"
fi
export SPLASH_NAME
# Uninstalls typically remove the files that make up the installer,
# which can cause problems on unix, so as a precautionary measure,
# cd to a safe place
cd /
# start the installer
${JAVA_HOME}/bin/java ${JAVA_OPTIONS} -Dinstall.engine=${theInstallEngine} \
-Dsims.native-file-dir=${INSTALL_HOME}/lib \
${INSTALLPROPS}
instCode=$?
unset theInstallEngine
unset theCP
}
#-------------------------------------------------------------------------------
# ****************************** MAIN THREAD ***********************************
#-------------------------------------------------------------------------------
LONGOPT="h(help)V(version)n:(dry-run)s:(configstate)a:(answerfile)R:(altroot)l:(level)m:(media-location)i:(installables)j:(javahome)J:(jvmoptions)C:(classpaths)c:(config-file)p:(properties)"
SHORTOPT="hVn:a:s:R:l:m:i:j:J:C:p:c:"
export TEXTDOMAINDIR
2.* | 5.7 | 5.8)
exit 1
;;
5.9)
;;
*)
;;
esac
else
# Linux has no built-in support for long-style getopts so we use the short style only
fi
# check arguments
while getopts "${OPTSTRING}" opt ; do
case "${opt}" in
# The engine knows how to deal with a leading "," so we can use this with no problems:
*:/*|*:[*)
# Answer file is a URL or contains substitutions, so don't try and parse it
ANSWERFILE="${ANSWERFILE},${OPTARG}"
;;
*)
# Answer file is not a URL, so resolve relative paths
if [ ! -d "${ANSDIR}" -o ! -w "${ANSDIR}" ]; then
exit 1
fi
ANSWERFILE="${ANSWERFILE},${ANSDIR}/${ANSNAME}"
;;
esac
;;
exit 1
fi
;;
*:/*|*:[*)
# Dry-Run file is a URL or contains substitutions, so don't try and parse it
DRYRUN="${OPTARG}"
;;
*)
# Dry-Run file is not a URL, so resolve relative paths
if [ ! -d "${DRYDIR}" -o ! -w "${DRYDIR}" ]; then
exit 1
fi
DRYRUN="${DRYDIR}/${DRYNAME}"
;;
esac
;;
s) CONFIGSTATE=${OPTARG}
;;
V) VERSIONFLAG=true
;;
l) DEBUGLEVEL=${OPTARG}
;;
;;
i) INSTALLABLES=${OPTARG}
;;
${PRINTF} "`${GETTEXT} '%s must be the root directory of a valid JVM installation'`\n" "${JAVAHOME}"
exit 1
fi
;;
;;
C) ADDITIONALCLASSPATHS=${OPTARG}
;;
p) INSTALLPROPS="${INSTALLPROPS} -p ${OPTARG}"
;;
c) INSTALLPROPS="${INSTALLPROPS} -c ${OPTARG}"
;;
?|h) usage
;;
esac
done
if [ -n "${VERSIONFLAG}" ] ; then
${ECHO} "openInstaller Install Framework 0.9.5"
${ECHO}
${ECHO}
exit 0
fi
# If its a dry-run and answer file is specified
# Verify if it already exists. if so, inform the user to choose a different
# answer file and quit.
if [ -n "${DRYRUN}" -a -f "${DRYRUN}" ] ; then
${PRINTF} "`${GETTEXT} 'Dry Run File %s already exists. Please choose a non-existing file path'`\n" "${DRYRUN}"
exit 1
fi
if [ -z "${JAVAHOME}" ] ; then
exit 1
fi
exit $instCode