Advertisement
Guest User

Matlab install script

a guest
Feb 7th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 23.35 KB | None | 0 0
  1. #!/compat/linux/bin/sh
  2. #
  3. # Name:
  4. #    install -  script file for invoking the Multi-platform installer on Linux.
  5. #
  6. #    Usage: install [-h|help]"
  7. #                              [-javadir <directory>] | [-root <directory>] |"
  8. #                              [-test] | [-v|-verbose]"
  9. #                              -h|-help        - Display arguments."
  10. #                              -test           - Don't actually run the java
  11. #                                                command (only useful with -v)."
  12. #                              -v|-verbose     - Display settings."
  13. #                              -javadir <directory>  - Override default java root directory."
  14. #                              -root <directory>     - Override default DVD root directory."
  15. #                              -tmpdir <directory>   - Override default directory for temporary files."
  16. #
  17. #              The default settings when no override inputs are supplied are:
  18. #              -root = <directory containing this script>
  19. #              -javadir = <root>/sys/java/jre/$ARCH/jre
  20. #              -tmpdir = /tmp"
  21. #
  22. #
  23. # Copyright 2009-2011 The MathWorks, Inc.
  24. #__________________________________________________________________________
  25. #
  26.     arg0_=$0
  27. #
  28. #
  29.     trap "exit 1" 1 2 3 15
  30. #
  31. #========================= java_launcher (start) ============================
  32. #
  33. #========================= archlist.sh (start) ============================
  34. #
  35. # usage:        archlist.sh
  36. #
  37. # abstract:     This Bourne Shell script creates the variable ARCH_LIST.
  38. #
  39. # note(s):      1. This file is always imbedded in another script
  40. #
  41. # Copyright 1997-2007 The MathWorks, Inc.
  42. # $Revision: 1.1.6.3 $  $Date: 2007/11/12 22:52:47 $
  43. #----------------------------------------------------------------------------
  44. #
  45.     ARCH_LIST='glnx86 glnxa64 mac maci maci64 sol2 sol64'
  46. #=======================================================================
  47. # Functions:
  48. #   check_archlist ()
  49. #=======================================================================
  50.     check_archlist () { # Sets ARCH. If first argument contains a valid
  51.             # arch then ARCH is set to that value else
  52.                 # an empty string. If there is a second argument
  53.             # do not output any warning message. The most
  54.             # common forms of the first argument are:
  55.             #
  56.             #     ARCH=arch
  57.             #     MATLAB_ARCH=arch
  58.             #     argument=-arch
  59.             #
  60.                         # Always returns a 0 status.
  61.                         #
  62.                         # usage: check_archlist arch=[-]value [noprint]
  63.                         #
  64.     if [ $# -gt 0 ]; then
  65.         arch_in=`expr "$1" : '.*=\(.*\)'`
  66.         if [ "$arch_in" != "" ]; then
  67.             ARCH=`echo "$ARCH_LIST EOF $arch_in" | awk '
  68. #-----------------------------------------------------------------------
  69.     { for (i = 1; i <= NF; i = i + 1)
  70.           if ($i == "EOF")
  71.           narch = i - 1
  72.       for (i = 1; i <= narch; i = i + 1)
  73.         if ($i == $NF || "-" $i == $NF) {
  74.             print $i
  75.             exit
  76.         }
  77.     }'`
  78. #-----------------------------------------------------------------------
  79.            if [ "$ARCH" = "" -a $# -eq 1 ]; then
  80. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  81. echo ' '
  82. echo "    Warning: $1 does not specify a valid architecture - ignored . . ."
  83. echo ' '
  84. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  85.            fi
  86.         else
  87.         ARCH=""
  88.         fi
  89.     else
  90.         ARCH=""
  91.     fi
  92. #
  93.     return 0
  94.     }
  95. #=======================================================================
  96. #========================= archlist.sh (end) ==============================
  97. ARCH=
  98. #========================= arch.sh (start) ============================
  99. #!/compat/linux/bin/sh
  100. #
  101. # usage:        arch.sh
  102. #
  103. # abstract:     This Bourne Shell script determines the architecture
  104. #               of the the current machine.
  105. #
  106. #               ARCH      - Machine architecture
  107. #
  108. #               IMPORTANT: The shell function 'check_archlist' is used
  109. #                          by this routine and MUST be loaded first.
  110. #                          This can be done by sourcing the file,
  111. #
  112. #                              archlist.sh
  113. #
  114. #                          before using this routine.
  115. #
  116. # note(s):      1. This routine must be called using a . (period)
  117. #
  118. #               2. Also returns ARCH_MSG which may contain additional
  119. #                  information when ARCH returns 'unknown'.
  120. #
  121. # Copyright 1986-2011 The MathWorks, Inc.
  122. #----------------------------------------------------------------------------
  123. #
  124. #=======================================================================
  125. # Functions:
  126. #   realfilepath ()
  127. #   matlab_arch ()
  128. #=======================================================================
  129.     realfilepath () { # Returns the actual path in the file system
  130.                       # of a file. It follows links. It returns an
  131.                       # empty path if an error occurs.
  132.                       #
  133.                       # Returns a 1 status if the file does not exist
  134.                       # or appears to be a circular link. Otherwise,
  135.                       # a 0 status is returned.
  136.                       #
  137.                       # usage: realfilepath filepath
  138.                       #
  139.     filename=$1
  140. #
  141. # Now it is either a file or a link to a file.
  142. #
  143.     cpath=`pwd`
  144.  
  145. #
  146. # Follow up to 8 links before giving up. Same as BSD 4.3
  147. #
  148.       n=1
  149.       maxlinks=8
  150.       while [ $n -le $maxlinks ]
  151.       do
  152. #
  153. # Get directory correctly!
  154. #
  155.     newdir=`echo "$filename" | awk '
  156.                        { tail = $0
  157.                          np = index (tail, "/")
  158.                          while ( np != 0 ) {
  159.                             tail = substr (tail, np + 1, length (tail) - np)
  160.                             if (tail == "" ) break
  161.                             np = index (tail, "/")
  162.                          }
  163.                          head = substr ($0, 1, length ($0) - length (tail))
  164.                          if ( tail == "." || tail == "..")
  165.                             print $0
  166.                          else
  167.                             print head
  168.                        }'`
  169.     if [ ! "$newdir" ]; then
  170.         newdir="."
  171.     fi
  172.     (cd "$newdir") > /dev/null 2>&1
  173.     if [ $? -ne 0 ]; then
  174.         return 1
  175.     fi
  176.     cd "$newdir"
  177. #
  178. # Need the function pwd - not the built in one
  179. #
  180.     newdir=`/bin/pwd`
  181. #
  182.     newbase=`expr //"$filename" : '.*/\(.*\)' \| "$filename"`
  183.         lscmd=`ls -ld "$newbase" 2>/dev/null`
  184.     if [ ! "$lscmd" ]; then
  185.         return 1
  186.     fi
  187. #
  188. # Check for link portably
  189. #
  190.     if [ `expr "$lscmd" : '.*->.*'` -ne 0 ]; then
  191.         filename=`echo "$lscmd" | awk '{ print $NF }'`
  192.     else
  193. #
  194. # It's a file
  195. #
  196.         dir="$newdir"
  197.         command="$newbase"
  198. #
  199.         cd "$dir"
  200. #
  201. # On Mac OS X, the -P option to pwd causes it to return a resolved path, but
  202. # on 10.5, -P is no longer the default, so we are now passing -P explicitly
  203. #
  204.             if [ "$ARCH" = 'mac' -o "$ARCH" = 'maci' -o "$ARCH" = 'maci64' ]; then
  205.                 echo `/bin/pwd -P`/$command
  206. #
  207. # The Linux version of pwd returns a resolved path by default, and there is
  208. # no -P option
  209. #
  210.             else
  211.                 echo `/bin/pwd`/$command
  212.             fi
  213.         break
  214.     fi
  215.     n=`expr $n + 1`
  216.       done
  217.       if [ $n -gt $maxlinks ]; then
  218.     return 1
  219.       fi
  220.  
  221.     cd "$cpath"
  222.     }
  223. #
  224. #=======================================================================
  225.     set_mac_arch() {
  226.         # First check to see if maci64 is even possible on this hardware
  227.         if [ "`/usr/sbin/sysctl -n hw.cpu64bit_capable`" = "0" ]; then
  228.             # maci64 is not possible. So set the arch to maci.
  229.             ARCH="maci"
  230.             return
  231.         fi
  232.  
  233.         # Now check to see if maci64 is asked for
  234.         if [ "$MACI64" = "0" ]; then
  235.             # only maci is wanted, so arch is maci.
  236.             ARCH="maci"
  237.             return
  238.         fi
  239.  
  240.         # If we get to this point, maci64 is available and desired. So, check to
  241.         # see if 64 bit binaries are available. First, if $MATLABROOT is NOT
  242.         # set, we can't really check for anything else.
  243.         if [ "$MATLABROOT" = "" ]; then
  244.             ARCH="maci64";
  245.             return
  246.         fi
  247.  
  248.  
  249.         # if we get to this point, we need to check the binaries that we have to
  250.         # find out if we have maci64 binaries
  251.         if [ -d "$MATLABROOT/bin/maci64" ]; then
  252.             ARCH="maci64"
  253.             return
  254.         fi
  255.  
  256.         # if we get to this point, even though maci64 is possible and desired,
  257.         # the maci64 binaries aren't available, so fall back to maci
  258.         ARCH="maci"
  259.     }
  260.  
  261. #
  262. #=======================================================================
  263.     matlab_arch () {  # Determine the architecture for MATLAB
  264.                       # It returns the value in the ARCH variable.
  265.                       # If 'unknown' is returned then sometimes a
  266.                       # diagnostic message is returned in ARCH_MSG.
  267.                       #
  268.                       # Always returns a 0 status.
  269.                       #
  270.                       # usage: matlab_arch
  271.                       #
  272.         ARCH="unknown"
  273. #
  274.         if [ -f /bin/uname ]; then
  275.             case "`/bin/uname`" in
  276.                 SunOS)                                  # Solaris
  277.                     case "`/bin/uname -p`" in
  278.                         sparc)
  279.                             ARCH="sol64"
  280.                             ;;
  281.                         i386)
  282.                             ARCH="sola64"
  283.                             ;;
  284.                     esac
  285.                     ;;
  286.                 Linux)
  287.                     case "`/bin/uname -m`" in
  288.                         i*86)
  289.                             ARCH="glnx86"
  290.                             ;;
  291.                         x86_64)
  292.                             ARCH="glnxa64"
  293.                             ;;
  294.                     esac
  295.                     ;;
  296. # Usually uname lives in /usr/bin on the Mac, but sometimes people
  297. # have links in /bin that link uname to /usr/bin.  Because of this
  298. # Mac needs to be listed in the checks for both /bin/uname and /usr/bin/uname
  299.                 Darwin)                                 # Mac OS X
  300.                     case "`/bin/uname -p`" in
  301.                         i386)
  302.                             set_mac_arch
  303.                             ;;
  304.                         esac
  305.                     ;;
  306.                 *)
  307.                     :
  308.                     ;;
  309.             esac
  310.         elif [ -f /usr/bin/uname ]; then
  311.             case "`/usr/bin/uname`" in
  312.                 Darwin)                                 # Mac OS X
  313.                     case "`/usr/bin/uname -p`" in
  314.                         i386)
  315.                             set_mac_arch
  316.                             ;;
  317.                         esac
  318.                     ;;
  319.             esac
  320.         fi
  321.         return 0
  322.     }
  323. #=======================================================================
  324. #
  325. # The local shell function check_archlist is assumed to be loaded before this
  326. # function is sourced.
  327. #
  328.     ARCH_MSG=''
  329.     check_archlist ARCH=$ARCH
  330.     if [ "$ARCH" = "" ]; then
  331.         if [ "$MATLAB_ARCH" != "" ]; then
  332.             check_archlist MATLAB_ARCH=$MATLAB_ARCH
  333.         fi
  334.         if [ "$ARCH" = "" ]; then
  335.             matlab_arch
  336.         fi
  337.     fi
  338.     Arch=$ARCH
  339. #========================= arch.sh (end) ==============================
  340.     setMac () {
  341.         if [ "$ARCH" = "maci" -o "$ARCH" = "maci64" ]; then
  342.             ISMAC=1
  343.         else
  344.             ISMAC=0
  345.         fi
  346.         export ISMAC
  347.          
  348.     }
  349. #=======================================================================
  350.     setVMenvironment () {
  351.     #   Set up some variables for the VM environment
  352.  
  353.     # Augment with AWT Motif default locale resource files
  354.     XFILESEARCHPATH="$JRE_LOC/lib/locale/%L/%T/%N%S:$XFILESEARCHPATH"
  355.     export XFILESEARCHPATH
  356.  
  357.     # Determine <final_load_library_path> for each platform
  358.     #
  359.     libraryPathsToAdd=$1
  360.    
  361.     case "$ARCH" in
  362.         glnx*)
  363.             LD_LIBRARY_PATH="`eval echo $LD_LIBRARY_PATH`"
  364.             if [ "$LD_LIBRARY_PATH" != "" ]; then
  365.                 LD_LIBRARY_PATH="$libraryPathsToAdd":$LD_LIBRARY_PATH
  366.             else
  367.                 LD_LIBRARY_PATH="$libraryPathsToAdd"
  368.             fi
  369.             export LD_LIBRARY_PATH
  370.             ;;
  371.         mac*)
  372.             DYLD_LIBRARY_PATH="`eval echo $DYLD_LIBRARY_PATH`"
  373.             if [ "$DYLD_LIBRARY_PATH" != "" ]; then
  374.                 DYLD_LIBRARY_PATH="$libraryPathsToAdd":$DYLD_LIBRARY_PATH
  375.             else
  376.                 DYLD_LIBRARY_PATH="$libraryPathsToAdd"
  377.             fi
  378.             export DYLD_LIBRARY_PATH
  379.             ;;
  380.         *)
  381.             LD_LIBRARY_PATH="`eval echo $LD_LIBRARY_PATH`"
  382.             if [ "$LD_LIBRARY_PATH" != "" ]; then
  383.                 LD_LIBRARY_PATH=$LD_LIBRARY_PATH
  384.             else
  385.                 LD_LIBRARY_PATH=
  386.             fi
  387.             export LD_LIBRARY_PATH
  388.             ;;
  389.     esac
  390.  
  391.     }
  392. #=======================================================================
  393.     setVMpath () {
  394.     #
  395.     # Determine the java vm path for each platform.
  396.     #
  397.  
  398.     if [ $ISMAC -eq 1 ]; then
  399.         JAVA_HOME_CMD=/usr/libexec/java_home
  400.         # Newer Macs have the java_home command,
  401.         # older ones (some 10.5 machines) might not. This check
  402.         # can be removed once 10.5 is no longer supported
  403.         if [ ! -f $JAVA_HOME_CMD ]; then
  404.             DEFAULT_JRE_LOC=/Library/Java/Home
  405.         else
  406.             # Ask for a 64-bit Java 1.6 (or higher) VM
  407.             DEFAULT_JRE_LOC=`$JAVA_HOME_CMD -v 1.6+ -d64 -F`
  408.             if [ $? != 0 ]; then
  409.                 # java_home couldn't find what we want so error out
  410.                 echo "Error: Cannot locate Java Runtime Environment (JRE)."
  411.                 exit 1
  412.             fi
  413.         fi
  414.     else
  415.         javaRoot=$1
  416.         DEFAULT_JRE_LOC=$javaRoot/jre/$ARCH/jre
  417.     fi
  418.  
  419.     if [ "$JRE_LOC" = "" ]; then
  420.         JRE_LOC=$DEFAULT_JRE_LOC
  421.     fi
  422. #
  423. # Look for JRE
  424. #
  425.     if [ ! -d "$JRE_LOC" ]; then
  426.         echo "---------------------------------------------------------------------------"
  427.         echo "Error: Cannot locate Java Runtime Environment (JRE)."
  428.         echo "The directory $JRE_LOC does not exist."
  429.         echo "---------------------------------------------------------------------------"
  430.         exit 1
  431.     fi
  432.     }
  433. #=======================================================================
  434.     getJarPaths () {
  435.     # Get the full search path for our jar files
  436.     # Echos the search path to stdout.
  437.  
  438.     JAVA_DIR="$1/java"
  439.     JAR_LOC="$JAVA_DIR/jar"
  440.     JAREXT_LOC="$JAVA_DIR/jarext"
  441.     JAR_SEARCH_PATHtmp=$JRE_LOC/lib/ext:$JAR_LOC:$JAREXT_LOC
  442.  
  443.     # Get list of directories in JAREXT_LOC
  444.     theDirList=`ls -1Ap "$JAREXT_LOC" | grep '/'`
  445.     # Add all subdirectories of JAREXT_LOC (but not recursively)
  446.     for aDir in $theDirList
  447.     do
  448.         JAR_SEARCH_PATHtmp=$JAR_SEARCH_PATHtmp:$JAREXT_LOC/$aDir
  449.     done
  450.  
  451.     # If MW_LIB_EXT_DIRS env var set, append value to existing search path
  452.     if [ "$MW_LIB_EXT_DIRS" != "" ]; then
  453.         JAR_SEARCH_PATHtmp=$JAR_SEARCH_PATHtmp:$MW_LIB_EXT_DIRS
  454.     fi
  455.  
  456.     echo $JAR_SEARCH_PATHtmp
  457.     }
  458. #=======================================================================
  459.     copyDirWritable() {
  460.     # Copy an entire directory.  This will create the destination
  461.     # directory, do a recursive copy, and then make all the files and
  462.     # directories writable.
  463.     # usage: copyDirWritable src dest
  464.     srcDir=$1
  465.     destDir=$2
  466.  
  467.     mkdir -p "$destDir"
  468.     cp -RLf "$srcDir"/* "$destDir"
  469.     chmod -R +w "$destDir" 2>/dev/null
  470.  
  471.     }
  472. #========================= java_launcher (end) ==============================
  473.     copyJREAndJarsToTmp () {
  474.     #
  475.     # Copy JRE and Jars to tmp
  476.     #
  477.     echo "Preparing installation files ..."
  478.     if [ $ISMAC -eq 0 ]; then
  479.     NEW_JRE_LOC="$TEMP_DIR/sys/java/jre/$ARCH/jre"
  480.         copyDirWritable "$JRE_LOC" "$NEW_JRE_LOC"
  481.     JRE_LOC=$NEW_JRE_LOC
  482.     fi
  483.     JAVA_DIR="$TEMP_DIR/java"
  484.     JAR_LOC="$JAVA_DIR/jar"
  485.     JAREXT_LOC="$JAVA_DIR/jarext"
  486.     copyDirWritable "$ROOT/java" "$JAVA_DIR"
  487.     }
  488. #=======================================================================
  489.     getJavaLaunchTarget () {
  490.     #   Find jar file to execute.
  491.     # TODO: Consolidate this code with getClassName() from activation and
  492.     #       move to java_launcher_template
  493.  
  494.     MAIN_CLASS="com/mathworks/professionalinstaller/Launcher"
  495.  
  496.     BOOTSTRAP_PROPERTIES=$ROOT/java/bootstrap.properties
  497.  
  498.     if [ -f "$BOOTSTRAP_PROPERTIES" ]; then
  499.         MAIN_CLASS_OVERRIDE=`grep -i mainclass "$BOOTSTRAP_PROPERTIES" | awk -F= '{ print $2 }' | sed 's/ //g'`
  500.         if [ "$MAIN_CLASS_OVERRIDE" != "" ]; then
  501.             MAIN_CLASS=$MAIN_CLASS_OVERRIDE
  502.         fi
  503.     fi
  504.  
  505.     #   By default, set launch target to main class
  506.     JAVA_LAUNCH_TARGETtmp=$MAIN_CLASS
  507.  
  508.     #   If MW_MAIN_CLASS env var set, set launch target to "$MW_MAIN_CLASS"
  509.     if [ "$MW_MAIN_CLASS" != "" ]; then
  510.         JAVA_LAUNCH_TARGETtmp=$MW_MAIN_CLASS
  511.     fi
  512.  
  513.     echo $JAVA_LAUNCH_TARGETtmp
  514.     }
  515. #=======================================================================
  516. #
  517. # Parse the arguments
  518. #
  519.     stat="OK"
  520.     JAR_LOC=
  521.     JAREXT_LOC=
  522.     JAR_SEARCH_PATH=
  523.     VERBOSE=0
  524.     TEMP_DIR="/tmp/mathworks_$$"
  525.     JRE_LOC=
  526.     XTRAFLAGS=
  527.     TESTONLY=0
  528.     arglist=
  529.     SHOW_SPLASH=1
  530.  
  531. #   Set default values for some variables if they are not set yet.
  532.     if [ "$ROOT" = "" ]; then
  533.         SETUP_FILE=`realfilepath "$0"`
  534.         ROOT=`dirname "$SETUP_FILE"`
  535.     fi
  536.  
  537.     while [ "$stat" = "OK" -a  $# -gt 0 ]; do
  538.         case "$1" in
  539.             -h|-help)
  540.                 stat=""
  541.                 ;;
  542.             -v|-verbose)
  543.                 VERBOSE=1;
  544.                 ;;
  545.             -javadir)
  546.                 if [ $# -eq 1 ]; then
  547.                     echo "A JRE directory must be specified with -javadir."
  548.                     stat=""
  549.                 else
  550.                     shift
  551.                     JRE_LOC=$1;
  552.  
  553.                     if [ ! -d "$JRE_LOC" ]; then
  554.                         echo "The directory $JRE_LOC does not exist."
  555.                         stat=""
  556.                     fi
  557.                     if [ ! -d "$JRE_LOC/lib" ]; then
  558.                         echo "$JRE_LOC does not appear to be a JRE directory."
  559.                         stat=""
  560.                     fi
  561.                 fi
  562.                 ;;
  563.             -root)
  564.                 if [ $# -eq 1 ]; then
  565.                     echo "A DVD directory must be specified with -root."
  566.                     stat=""
  567.                 else
  568.                     shift
  569.                     ROOT=$1;
  570.                     if [ ! -d "$ROOT" ]; then
  571.                         echo "The directory $ROOT does not exist."
  572.                         stat=""
  573.                     fi
  574.                 fi
  575.                 ;;
  576.             -tmpdir)
  577.                 if [ $# -eq 1 ]; then
  578.                     echo "A directory for temporary files must be specified with -tmpdir."
  579.                     stat=""
  580.                 else
  581.                     shift
  582.                     TEMP_DIR="$1/mathworks_$$"
  583.                 fi
  584.                 ;;
  585.             -test)
  586.                 # Just run through script without actually running the java
  587.                 # command.  Only useful with -v.
  588.                 TESTONLY=1
  589.                 ;;
  590.             -psn*)
  591.                 # Apple passes this in with things that are double clicked. Ignore.
  592.                 ;;
  593.             -*)
  594.                 OPTION=$1
  595.                 OPTION="$(echo ${OPTION} | tr '[:upper:]' '[:lower:]')"
  596.                 if [ $OPTION = "-mode" ]; then
  597.                     SHOW_SPLASH=0
  598.                 fi
  599.                 if [ $OPTION = "-inputfile" ]; then
  600.                     SHOW_SPLASH=0
  601.                 fi
  602.                 found=0
  603.                 # Check for -arch
  604.                 arch=$ARCH
  605.                 check_archlist argument=$1 noprint
  606.                 if [ "$ARCH" != "" ]; then
  607.                     found=1
  608.                 else
  609.                     ARCH=$arch
  610.                 fi
  611.                 if [ "$found" = "0" ]; then
  612.                     arglist="$arglist $1"
  613.                 fi
  614.                 ;;
  615.             *)
  616.                 arglist="$arglist $1"
  617.                 ;;
  618.         esac
  619.         shift
  620.     done
  621.     setMac
  622. #
  623. # Check for errors
  624. #
  625.     if [ "$stat" != "OK" ]; then        # An error occurred.
  626. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  627.     echo ""
  628.     echo "   Usage: install [-h|help]"
  629.     echo "                             [-javadir <directory>] | [-root <directory>] |"
  630.     echo "                             [-test] | [-v|-verbose]"
  631.     echo ""
  632.     echo "    -h|-help        - Display arguments."
  633.     echo "    -test           - Don't actually run the java command (only useful with -v)."
  634.     echo "    -v|-verbose     - Display settings."
  635.     echo "    -javadir <directory>       - Override default java root directory."
  636.     echo "    -root <directory>          - Override default DVD root directory."
  637.     echo "    -tmpdir <directory>        - Override default directory for temporary files."
  638.     echo ""
  639.     echo "    The default settings when no override inputs are supplied are: "
  640.     echo "    -root = <directory containing this script>"
  641.     echo "    -javadir = <root>/sys/java/jre/$ARCH/jre"
  642.     echo "    -tmpdir = /tmp"
  643.     echo ""
  644. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  645.         exit 1
  646.     fi
  647.  
  648. #   Determine the java vm path for each platform.
  649.     setVMpath "$ROOT/sys/java"
  650.     copyJREAndJarsToTmp
  651.  
  652. #   Set up some variables for the VM environment.
  653.     copyDirWritable "$ROOT/bin/$ARCH" "$TEMP_DIR/bin/$ARCH"
  654.     setVMenvironment "$TEMP_DIR/bin/$ARCH"
  655.  
  656. #   Get the jar directories
  657.     JAR_SEARCH_PATH=`getJarPaths "$TEMP_DIR"`
  658.  
  659. #   Get the java launch target
  660.     JAVA_LAUNCH_TARGET=`getJavaLaunchTarget`
  661.  
  662. #   Set up splash option
  663.     if [ $SHOW_SPLASH -eq 1 ]; then
  664.         SPLASH_OPTION="-splash:\"$ROOT/java/splash.png\""
  665.     else
  666.         SPLASH_OPTION=""
  667.     fi
  668.  
  669. #   Set up java command to run.
  670.     if [ $ISMAC -eq 1 ]; then
  671.         XTRAFLAGS="-d64 -Xdock:name=\"Install MATLAB\" -Xdock:icon=\"$ROOT/InstallForMacOSX.app/Contents/Resources/membrane.icns\""
  672.     fi
  673.     java_exe=$JRE_LOC/bin/java
  674.     java_cmd="$java_exe -Xmx512m $XTRAFLAGS $SPLASH_OPTION -Djava.ext.dirs=$JAR_SEARCH_PATH $JAVA_LAUNCH_TARGET -root \"$ROOT\" -tmpdir \"$TEMP_DIR\" $arglist"
  675.  
  676. #
  677.     if [ "$VERBOSE" = "1" ]; then
  678. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  679.     echo "->  DVD                 = $ROOT"
  680.     echo "->  ARCH                = $ARCH"
  681.     echo "->  DISPLAY             = $DISPLAY"
  682.     echo "->  TESTONLY            = $TESTONLY"
  683.     echo "->  JRE_LOC             = $JRE_LOC"
  684. #
  685.         case "$ARCH" in
  686.             mac*)
  687.     echo "->  DYLD_LIBRARY_PATH   = $DYLD_LIBRARY_PATH"
  688.                 ;;
  689.             *)
  690.     echo "->  LD_LIBRARY_PATH     = $LD_LIBRARY_PATH"
  691.                 ;;
  692.         esac
  693.  
  694.     echo " "
  695.     echo "Command to run:"
  696.     echo "$java_cmd"
  697.     echo " "
  698. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  699.     fi
  700. #
  701. #
  702. #   Run the java command to start the install app
  703.     if [ "$TESTONLY" != "1" ]; then
  704.         echo "Installing ..."
  705.         eval $java_cmd
  706.  
  707. #   Clean up
  708.         rm -rf $TEMP_DIR
  709.     fi
  710.  
  711.     echo "Finished"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement