Changeset 30103 for main/trunk


Ignore:
Timestamp:
2015-08-12T21:02:48+12:00 (9 years ago)
Author:
ak19
Message:

Mounted drive's .app may not have writable contents. Instead, we make no assumptions about writeability. The jre_bin is now copied into /tmp and made writeable there before being extracted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/release-kits/shared/mac/Wrapper.app/Contents/MacOS/greenstone

    r30101 r30103  
    1717
    1818if [[ -e "$BASEDIR/Resources/Java/jre_bin" ]]; then
    19   if [[ -w "$BASEDIR/Resources/Java" ]]; then
    20      chmod +x "$BASEDIR/Resources/Java/jre_bin" && "$BASEDIR/Resources/Java/jre_bin" -o"/tmp" #&& rm "$BASEDIR/Resources/Java/jre_bin"
     19     cp "$BASEDIR/Resources/Java/jre_bin" /tmp/. && chmod +x "/tmp/jre_bin" && "/tmp/jre_bin" -o"/tmp" #&& rm "/tmp/jre_bin"
    2120
    2221     if [[ -e "/tmp/jre.tar" ]]; then
    23 
     22        rm /tmp/jre_bin
    2423        # get the GS jar installer's name and run it
    2524        cd "$BASEDIR/Resources/Java/"
    2625        gs_installer=`ls Greenstone-*-MacOS-intel.jar`
    27         tar -xvf /tmp/jre.tar -C /tmp && "/tmp/jre/bin/java" -jar "$gs_installer"
    28         rm /tmp/jre.tar         
     26        tar -xvf /tmp/jre.tar -C /tmp && rm /tmp/jre.tar && "/tmp/jre/bin/java" -jar "$gs_installer"
    2927
    30      else
     28     else
     29       # Issues extracting the jre.tar into /tmp (maybe we couldn't even copy it there) - display error message
     30       # see: https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW11
    3131        osascript -e "tell app \"System Events\" to display alert \"Unable to unpack jre into /tmp folder\" as warning giving up after 10"   
     32       # exit
    3233     fi
    33   else
    34   # Installation directory not writable - display error message
    35   # see: https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW11
    36      osascript -e 'tell app "System Events" to display alert "To install Greenstone, double-click on the installer app" as warning giving up after 10'
    37      exit
    38   fi
    3934fi
Note: See TracChangeset for help on using the changeset viewer.