#!/bin/bash BINDIR="`dirname "$0"`" cd "$BINDIR/.." BASEDIR="`pwd`" # extract JRE on first run if [[ -e "$BASEDIR/Resources/jre_bin" ]]; then if [[ -w "$BASEDIR/Resources" ]]; then chmod +x "$BASEDIR/Resources/jre_bin" && "$BASEDIR/Resources/jre_bin" -o"$BASEDIR/Resources" && rm "$BASEDIR/Resources/jre_bin" else # Installation directory not writable - display error message # see: https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW11 osascript -e 'tell app "System Events" to display alert "The installation directory is not writable!\nTo install Expeditee, drag and drop the app wherever you would like to install it (such as the Applications folder or your desktop).\nOnce Expeditee is installed, you can run Expeditee by double-clicking on the installed app" as warning giving up after 10' exit fi fi # run expeditee "$BASEDIR/Resources/jre/bin/java" -jar "$BASEDIR/Resources/Expeditee.jar"