source: main/trunk/release-kits/shared/mac/Wrapper.app/Contents/MacOS/greenstone@ 30118

Last change on this file since 30118 was 30118, checked in by ak19, 7 years ago

Correcting location of icon.icns

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3BINDIR="`dirname "$0"`"
4cd "$BINDIR/.."
5BASEDIR="`pwd`"
6
7# Debugging with a msg box. Need double quotes around msg for $var expansion
8#osascript -e "tell app \"System Events\" to display alert \"bindir is: $BINDIR\" as warning giving up after 10"
9
10## But this doesn't work:
11# http://stackoverflow.com/questions/23923017/osascript-using-bash-variable-with-a-space
12#osascript -e "display notification \"$BINDIR\""
13#osascript -e 'display notification "'"$BINDIR"'"'
14
15# extract the JRE into /tmp and use its java to run the GS jar installer
16# the /tmp/jre folder will be moved into GS3/packages by the GS3 installer
17
18if [[ -e "$BASEDIR/Resources/Java/jre_bin" ]]; then
19 cp "$BASEDIR/Resources/Java/jre_bin" /tmp/. && chmod +x "/tmp/jre_bin" && "/tmp/jre_bin" -o"/tmp" #&& rm "/tmp/jre_bin"
20
21 if [[ -e "/tmp/jre.tar" ]]; then
22 rm /tmp/jre_bin
23 # 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)
24 cd "$BASEDIR/Resources/Java/"
25 gs_installer=`ls Greenstone-*-MacOS-intel.jar`
26 tar -xvf /tmp/jre.tar -C /tmp && rm /tmp/jre.tar && "/tmp/jre/bin/java" -jar -Xdock:icon="$BASEDIR/Resources/icon.icns" "$gs_installer"
27
28 # if after running the installer, the user cancelled installation, then the jre would still be in tmp, remove it to
29 if [[ -e "/tmp/jre" ]]; then
30 rm -rf /tmp/jre
31 fi
32
33 else
34 # Issues extracting the jre.tar into /tmp (maybe we couldn't even copy it there) - 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 \"Unable to unpack jre into /tmp folder\" as warning giving up after 10"
37 # exit
38 fi
39fi
Note: See TracBrowser for help on using the repository browser.