- Timestamp:
- 2023-04-17T20:35:59+12:00 (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/release-kits/shared/mac/Wrapper.app/Contents/MacOS/greenstone
r31141 r37672 4 4 cd "$BINDIR/.." 5 5 BASEDIR="`pwd`" 6 7 displayUsage() { 8 echo "Usage: $0 [OPTIONS]" 9 echo "OPTIONS: " 10 echo " -h, -help Display this usage message" 11 echo " -textonly Do a non-graphical command line installation" 12 echo " -extract Extract the jar file, this can then be run manually (such as with custom Java options as arguments to the installer jar file)." 13 } 14 15 # install_mode can be: 16 # Default behaviour (graphical installer, forced to textonly mode in non-graphical environment 17 # manual setting to Textonly mode 18 # Extract mode to extract jar file 19 install_mode="default" 20 21 22 if [ "x$1" != "x" ]; then 23 if [ "$1" == "-h" ] || [ "$1" == "-help" ] || [ "$1" == "--help" ] ; then 24 displayUsage 25 exit 0 26 elif [ "$1" == "-textonly" ] || [ "$1" == "-text" ] || [ "$1" == "text" ] ; then 27 install_mode="textonly" 28 elif [ "$1" == "-extract" ] || [ "$1" == "--extract" ] || [ "$1" == "-x" ] ; then 29 install_mode="extract" 30 else 31 displayUsage 32 exit 0 33 fi 34 fi 35 6 36 7 37 # Debugging with a msg box. Need double quotes around msg for $var expansion … … 26 56 export JRE_HOME=/tmp/jre 27 57 export PATH=$JRE_HOME/bin:$PATH 28 tar -xvf /tmp/jre.tar -C /tmp && rm /tmp/jre.tar && "/tmp/jre/bin/java" -jar -Xdock:icon="$BASEDIR/Resources/icon.icns" "$gs_installer"58 #tar -xvf /tmp/jre.tar -C /tmp && rm /tmp/jre.tar && "/tmp/jre/bin/java" -jar -Xdock:icon="$BASEDIR/Resources/icon.icns" "$gs_installer" 29 59 60 tar -xvf /tmp/jre.tar -C /tmp && rm /tmp/jre.tar 61 62 if [ "$install_mode" = "extract" ] ; then 63 # no need to extract: installer jar file already available in mac app 64 echo "" 65 echo "(Extracting jar file on mac is superfluous: the jar file is already ready for use at $gs_installer)" 66 echo "You can now run '/tmp/jre/bin/java -jar \"$BASEDIR/Resources/Java/$gs_installer\" text'" 67 echo " to run the installer from the command line." 68 echo "Once you're finished with the installer, you can run \"rm -rf /tmp/jre\" to get rid of the temporary Java Runtime." 69 echo "Note: if the installer fails to run due to insufficient memory, try preceding the -jar with -Xmx300M in the above command." 70 echo "" 71 elif [ "$install_mode" = "textonly" ] ; then 72 "/tmp/jre/bin/java" -Xmx300M -jar "$gs_installer" "text" 73 else # "$install_mode" = "default", run the usual graphical GS3 mac installer 74 # which already falls back to textonly mode if no graphical environment available 75 "/tmp/jre/bin/java" -jar -Xdock:icon="$BASEDIR/Resources/icon.icns" "$gs_installer" 76 fi 77 30 78 # if after running the installer, the user cancelled installation, then the jre would still be in tmp, remove it to 31 if [[ -e "/tmp/jre" ]]; then 32 rm -rf /tmp/jre 33 fi 34 79 if [ "$install_mode" != "extract" ] ; then 80 if [[ -e "/tmp/jre" ]]; then 81 rm -rf /tmp/jre 82 fi 83 fi 35 84 else 36 85 # Issues extracting the jre.tar into /tmp (maybe we couldn't even copy it there) - display error message … … 41 90 else 42 91 # try using a system java to run the installer, as there is no bundled jre_bin for 32 bit Mac OS since these already came with java installed 43 92 " -h, -help Display this usage message" 93 44 94 # get the GS jar installer's name and run it with a dock icon (http://stackoverflow.com/questions/6006173/how-do-you-change-the-dock-icon-of-a-java-program) 45 95 cd "$BASEDIR/Resources/Java/"
Note:
See TracChangeset
for help on using the changeset viewer.