📄 setup_linux
字号:
dbg "Temporary files will be cleanedup after the installation." fi fi}executeLauncher(){ [ $ismpVV ] && dbg "running inner launcher". [ $ismpVV ] && dbg "original command line args $@" [ "$FILEINDEXCOUNT" -ne 1 ] && { dbg "Error extracting inner launcher. Failed to launch the application." return } TYPE=`awk 'END{ split(a,FIELDS, ":"); print FIELDS[1]; }' a=$FILEINDEX0 </dev/null 2>/dev/null` TYPE=`convert $TYPE` if [ "$TYPE" -eq $BIN_FILE_TYPE ] ; then SIZE=`awk 'END{ split(a,FIELDS, ":"); print FIELDS[3] }' a=$FILEINDEX0 </dev/null 2>/dev/null` OFFSET=`awk 'END{ split(a,FIELDS, ":"); print FIELDS[4] }' a=$FILEINDEX0 </dev/null 2>/dev/null` NAME=`awk 'END{ split(a,FIELDS, ":"); print FIELDS[5] }' a=$FILEINDEX0 </dev/null 2>/dev/null` SIZE=`convert $SIZE` OFFSET=`convert $OFFSET` NAME="$ISTEMP/$NAME.embedded" extractAFile fi INNER_LAUNCHER="$NAME" if [ -f "$INNER_LAUNCHER" ] ; then archiveSize=`wc -c "$INNER_LAUNCHER" | awk '{ if ( $1 ~ /^[0-9]/ ) print $1 ; else print 0; }'` if [ $archiveSize -ne $SIZE ] ; then archiveSize=`ls -l "$INNER_LAUNCHER" | awk '{ if ( $5 ~ /^[0-9]/ ) print $5 ; else print 0; }'` if [ $archiveSize -ne $SIZE ] ; then dbg "Error extracting inner launcher. Archive may be corrupt. Failed to launch the application." return fi fi else dbg "Inner launcher can not be found. Failed to launch the application." return fi MEDIA_LOCATION=`dirname $INSTALLER_PATH` runInnerLauncher=`awk 'END{ s=sprintf("%s -is:orig %s %s", c, b, a); print s; }' a="$@" b="$MEDIA_LOCATION" c="$INNER_LAUNCHER" </dev/null 2>/dev/null` chmod 744 "$INNER_LAUNCHER" dbg "running inner launcher=$runInnerLauncher" eval "exec $runInnerLauncher" exit 0}tempLocationErrMesg(){cat << END Temporary directory, $1 does not exist and can not be created. The current user may not have the necessary permission to write to the directory. Please specify another temporary directory with the option -is:tempdir. Use the -is:help option for more information. END}help(){cat << STOPUsage : `basename $0` [OPTIONS] [APPLICATION_ARGUMENTS] Where OPTIONS include: -is:javahome <dir> JRE home which points to directory containing bin/java. -is:tempdir <dir> Temporary directory to be used by the launcher. -cp:a <classpath> Append <classpath> to the launcher's classpath. -cp:p <classpath> Prepend <classpath> to the launcher's classpath. -is:log <filename> Log debug messages to <file>. -is:extract Extracts the contents of the archive. -is:nospacecheck Turns off the launcher disk space checking. -is:version Returns launcher version and exits. -is:help Prints this help message and exitsSTOP}VerifyResolvedJVM(){ dbg "Verifying resolved JVM" makeJVMFit extractJVMFiles verifedJVMFile=`cat "$ISTEMP/jvmlist" | xargs awk '/^JVM_HOME:.+/{ print FILENAME; exit }' 2>/dev/null` #Verify the resolved JVM file if [ -f "$verifedJVMFile" ] ; then JVM_HOME=`awk 'BEGIN { FS=":" } $1 == tag { i=index($0,":"); s=substr($0,i+1); print s; exit; }' tag=JVM_HOME "$verifedJVMFile" 2>/dev/null` JVM_HOME=`echo "$JVM_HOME" | sed 's/^[ ]*//;s/[ ]*$//;s/^[ ]*//;s/[ ]*$//'` [ ! -d "$JVM_HOME" ] && { dbg "JVM_HOME is not found in the jvm file $verifedJVMFile." return } JVM_EXE=`awk 'BEGIN { FS=":" } $1 == tag { i=index($0,":"); s=substr($0,i+1); print s; exit; }' tag=JVM_EXE "$verifedJVMFile" 2>/dev/null` JVM_EXE=`echo "$JVM_EXE" | sed 's/^[ ]*//;s/[ ]*$//;s/^[ ]*//;s/[ ]*$//;s/\"//g'` [ -z "$JVM_EXE" ] && { dbg "Javaexe is not found or empty in the jvm file $verifedJVMFile." return } VerifyJVM "$verifedJVMFile" "$JVM_HOME/$JVM_EXE" if [ $verify -eq 0 ] ; then RESOLVED_JVM="$verifedJVMFile" resolvedJVMVerified=0 dbg "Verification passed for $JVM_HOME/$JVM_EXE using the JVM file $verifedJVMFile." else dbg "Verification failed for $JVM_HOME/$JVM_EXE using the JVM file $verifedJVMFile." fi else dbg "resolved jvm file can not be found. Try to launch the application by searching a JVM..." fi}executeExternalInstructions(){ if [ -f "$1" ] ; then SILENT=true initialize LOG=`awk '/^LOG/ { i=index($0,"="); s=substr($0,i+1); print s; exit }' "$1" 2>/dev/null` [ -n "$LOG" ] && { touch "$ISTEMP/$LOG" if [ -f "$ISTEMP/$LOG" ] ; then LOG="$ISTEMP/$LOG" DBG=1 else LOG= fi } action=`awk '/^ACTION/ { i=index($0,"="); s=substr($0,i+1); print s; exit }' "$1" 2>/dev/null` if [ -n "$action" ] ; then if [ "$action" = "SEARCHJVM" ] ; then dbg "searching JVM" awk '/^JVMFILE[0-9]+/ { i=index($0,"="); s=substr($0,i+1); print s >> f; }' f="$ISTEMP/jvmlist" "$1" 2>/dev/null if [ -f "$ISTEMP/jvmlist" ] ; then jvmFileslc=`wc -l "$ISTEMP/jvmlist" | awk '{ print $1 }' 2>/dev/null` if [ "$jvmFileslc" -gt 0 ] ; then VERIFY_JAR=`awk '/^VERIFY_JAR/ { i=index($0,"="); s=substr($0,i+1); print s ; }' "$1" 2>/dev/null` if [ -f "$VERIFY_JAR" ] ; then cp "$VERIFY_JAR" "$ISTEMP/." if [ -f "$ISTEMP/Verify.jar" ] ; then jvmFilescc=1 while [ "$jvmFilescc" -le "$jvmFileslc" ] ; do JVM_FILE=`sed -n -e "${jvmFilescc}p" "$ISTEMP/jvmlist" 2>/dev/null` if [ -f "$JVM_FILE" ] ; then sed "s/
//;s/^[ ]*//;s/[ ]*$//" "$JVM_FILE" >> "$JVM_FILE.sed" 2>/dev/null rm -f "$JVM_FILE" mv "$JVM_FILE.sed" "$JVM_FILE" fi jvmFilescc=`expr "$jvmFilescc" + 1` done checkEnvironment if [ $sv -eq 0 ] ; then dbg "jvm found using an environment variable and verfication passed for $JVM_FILE." JVM_HOME=`awk '/^JVM_HOME/ { i=index($0,":"); s=substr($0,i+1); print s ; }' "$RESOLVED_JVM" 2>/dev/null` echo 1 echo "$JVM_HOME" echo "$RESOLVED_JVM" else jvmFilescc=1 while [ "$jvmFilescc" -le "$jvmFileslc" ] ; do JVM_FILE=`sed -n -e "${jvmFilescc}p" "$ISTEMP/jvmlist" 2>/dev/null` if [ -f "$JVM_FILE" ] ; then searchAndVerify "$JVM_FILE" if [ "$sv" -eq 0 ] ; then dbg "jvm found and verfication passed for $JVM_FILE." JVM_HOME=`awk '/^JVM_HOME/ { i=index($0,":"); s=substr($0,i+1); print s ; }' "$RESOLVED_JVM" 2>/dev/null` echo 1 echo "$JVM_HOME" echo "$RESOLVED_JVM" break fi fi jvmFilescc=`expr "$jvmFilescc" + 1` done fi else dbg "Error copying Verify.jar . JVM Verification can't be performed." fi else dbg "Verify class is missing . JVM Verification can't be performed." fi else dbg "JVM files are not specified. JVM search can't be performed." fi else dbg "JVM file list is missing. JVM search can't be performed." fi elif [ "$action" = "INSTALL_JVM" ] ; then dbg "Installing JVM" BUNDLED_JRE=`awk '/^BUNDLED_JRE/ { i=index($0,"="); s=substr($0,i+1); print s; exit }' "$1" 2>/dev/null` if [ -f "$BUNDLED_JRE" ] ; then dbg "Bundled JRE file is = $BUNDLED_JRE" DESTINATION_DIR=`awk '/^DESTINATION_DIR/ { i=index($0,"="); s=substr($0,i+1); print s; exit }' "$1" 2>/dev/null` if [ -n "$DESTINATION_DIR" ] ; then dbg "Destination directory is = $DESTINATION_DIR" touch "$DESTINATION_DIR/iswritable" 2>/dev/null 1>&2 if [ \( $? -eq 0 \) -a \( -f "$DESTINATION_DIR/iswritable" \) ] ; then dbg "Beginning to install bundled JRE." rm -f "$DESTINATION_DIR/iswritable" whereAmI=`pwd` mkdir "$DESTINATION_DIR" >/dev/null 2>&1 checkDiskSpace "$BUNDLED_JRE" "$DESTINATION_DIR" if [ "$disk_space_check" -eq 0 ] ; then cd "$DESTINATION_DIR" dbg "installing bundled JRE..." "$BUNDLED_JRE" -qq >/dev/null 2>&1 if [ $? -ne 0 ] ; then cd "$whereAmI" dbg "Error installing bundled JRE. Failed to launch the application." else cd "$whereAmI" dbg "Installing bundled JRE successful." fi chmod -R 744 "$DESTINATION_DIR" > /dev/null 2>&1 J="$DESTINATION_DIR" J=`echo "$J" | sed 's/^[ ]*//;s/[ ]*$//;s/^[ ]*//;s/[ ]*$//'` echo "JVM_HOME:$J" >> "$DESTINATION_DIR/jvm" if [ -f "$DESTINATION_DIR/jvm" ] ; then echo "$DESTINATION_DIR/jvm" else dbg "Installation of bundled JRE failed." fi else dbg "diskspace check failed.Installation of bundled JRE failed." fi else dbg "Install Destination directory for bundled JRE is non-writable. Installation of bundled JRE failed." fi else dbg "Install Destination directory for bundled JRE is missing. Installation of bundled JRE failed. " fi else dbg "Bundled JRE file $BUNDLED_JRE is missing. Installation of bundled JRE failed." fi else dbg "unknown ACTION TAG" fi else dbg "ACTION TAG is missing in the input instructions file. JVM search can't be performed." fi cleanupandexit 0 else dbg "Input instructions file missing. JVM Service operation failed." fi}handleApplicationExitStatus(){ [ "$applicationExitStatus" ] && [ \( -z "$SILENT" -a "$applicationExitStatus" -ne 0 \) ] && { pbl [ "$ismpVV" ] && applicationExitStatusMesg="The application is aborted with exit code $applicationExitStatus."cat << handleApplicationExitStatusSTOP $applicationExitStatusMesg handleApplicationExitStatusSTOP [ -f "$ISTEMP/APP_STDERR" ] && cat "$ISTEMP/APP_STDERR" }}mode(){ mode=`awk 'END { i=index(a, "-is:in"); print i }' a="$1" </dev/null 2>/dev/null` if [ "$mode" -ge 1 ] ; then main "$@" fi }_XPG=1 # to maintain backward compatibility with bourne shell on IRIX. See IRIX man pages of sh for more details.BIN_SH=xpg4 # for True64 to use POSIX compliant shell.mode "$@" chkprereq(){ OS=`uname -s` if [ "$OS"="Linux" ] ; then if [ -f /etc/redhat-release ] ; then version=`cat /etc/redhat-release` if [ \( "$version"="Red Hat Enterprise Linux WS release 4 (Nahant)" -o "$version"="Red Hat Enterprise Linux WS release 3 (Taroon)" \) ] ; then if [ -f /usr/lib/libstdc++-libc6.1-1.so.2 ] ; then echo else echo " The installer is unable to proceed due to a missing library" echo " libstdc++-libc6.1-1.so.2 on this host. Please contact your" echo " System Administrator to install Legacy Software Development Package." echo " " exit 1 fi fi fi else echo fi}setPreLaunchEnvironment(){dbg "setting up prelaunch environment"}expandDiskPartition(){echo 0}FILEINDEX0=05:00000000:000003F1:0000F000:Verify.jar:00:00000001:00000000FILEINDEX1=01:00000001:0000119D:0000F400:wrsunjre142.jvm:00:00000001:00000000FILEINDEX2=08:00000002:00000044:00010800:JVMNotFound.txt:00:00000001:00000000FILEINDEXCOUNT=3Launch(){launcherParentDir=`dirname "$0"`resolveLaunchCommand "$RESOLVED_JVM"if [ $resolve -ne 0 ]; then dbg "Launch Script can't not be resolved. Run the installer with -is:log <logfile> to view the errors."cleanupandexit 3elsepbmesg="Launching InstallShield Wizard"pbc=8pbpblpblsetPreLaunchEnvironmentJC="\""$JVM_HOME/$JVM_EXE"\" $CLASSPATH_SWITCH .:$PREPEND_CLASSPATH:$CP1:"$JVM_CLASSPATH":$CP:\"`awk 'END{ s=sprintf("%s/%s",a,b); print s}' a="$launcherParentDir" b="output.jar" <</dev/null`\":$INSTALLER_ARCHIVE:$EMBEDDED_JARS:$CP2:$CLASSPATH:$APPEND_CLASSPATH: -Dtemp.dir=\"$IS_TEMP_DIR\" -Dis.jvm.home=\"$IS_JVM_HOME\" -Dis.jvm.temp=\"$IS_JVM_TEMP\" -Dis.media.home=\"$APPLICATION_ARCHIVE\" -Dis.launcher.file=\"$IS_LAUNCHER_FILE\" -Dis.jvm.file=\"$IS_JVM_FILE\" -Dis.external.home=\"$MEDIA_DIR\" "$RUNTIME_SYSTEMPROP" $JAVA_ARGS run "$app_args" 1>$APP_STDOUT 2>$APP_STDERR"dbg LAUNCH_COMMAND="$JC"eval $JCapplicationExitStatus=$?fi}setpbmesg(){pbmesg="Initializing InstallShield Wizard"}#INSTRUCTIONS for the generic unix launcher.Instructions(){searchJVMif [ $sv -eq 0 ] ; thenLaunchfi}main "$@"################################################################################################################################################################################################################################################################################################################################PK