diff --git a/installer/appbundle/filebot.sh b/installer/appbundle/filebot.sh index 94237bfb..bbe871ed 100644 --- a/installer/appbundle/filebot.sh +++ b/installer/appbundle/filebot.sh @@ -20,4 +20,5 @@ APP_ROOT=`cd "$PRG_DIR/../.." && pwd` # restore original working dir cd "$WORKING_DIR" -java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=app "-Djna.library.path=$APP_ROOT/Contents/MacOS" "-Djava.library.path=$APP_ROOT/Contents/MacOS" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/Contents/MacOS/fpcalc" -jar "$APP_ROOT"/Contents/Java/* "$@" + +java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=app "-Djna.library.path=$APP_ROOT/Contents/MacOS" "-Djava.library.path=$APP_ROOT/Contents/MacOS" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/Contents/MacOS/fpcalc" -jar "$APP_ROOT"/Contents/Java/* "$@" \ No newline at end of file diff --git a/installer/portable/filebot.sh b/installer/portable/filebot.sh index e9c4dc6c..f076d0e6 100644 --- a/installer/portable/filebot.sh +++ b/installer/portable/filebot.sh @@ -1,9 +1,27 @@ -#!/bin/bash -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -dir_bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +#!/bin/sh +PRG="$0" + +# resolve relative symlinks +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi +done + +# make it fully qualified +WORKING_DIR=`pwd` +PRG_DIR=`dirname "$PRG"` +APP_ROOT=`cd "$PRG_DIR" && pwd` + +# restore original working dir +cd "$WORKING_DIR" + # force JVM language and encoding settings export LANG=en_US.utf8 -java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=portable -Dapplication.analytics=true -Dapplication.warmup=false -Dnet.filebot.AcoustID.fpcalc=fpcalc "-Dapplication.dir=$dir_bin" "-Djava.io.tmpdir=$dir_bin/temp" "-Duser.home=$dir_bin" "-Djna.library.path=$dir_bin" "-Djava.library.path=$dir_bin" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$dir_bin/prefs.properties" -jar "$dir_bin/FileBot.jar" "$@" +java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=portable -Dapplication.analytics=true -Dapplication.warmup=false -Dnet.filebot.AcoustID.fpcalc=fpcalc "-Dapplication.dir=$APP_ROOT" "-Djava.io.tmpdir=$APP_ROOT/temp" "-Duser.home=$APP_ROOT" "-Djna.library.path=$APP_ROOT" "-Djava.library.path=$APP_ROOT" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$APP_ROOT/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@" \ No newline at end of file diff --git a/installer/portable/update-filebot.sh b/installer/portable/update-filebot.sh index a5054348..4cc35c4b 100644 --- a/installer/portable/update-filebot.sh +++ b/installer/portable/update-filebot.sh @@ -1,8 +1,26 @@ -#!/bin/bash -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -INSTALL_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +#!/bin/sh +PRG="$0" -JAR_FILE="$INSTALL_DIR/FileBot.jar" +# resolve relative symlinks +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi +done + +# make it fully qualified +WORKING_DIR=`pwd` +PRG_DIR=`dirname "$PRG"` +APP_ROOT=`cd "$PRG_DIR" && pwd` + +# restore original working dir +cd "$WORKING_DIR" + + +JAR_FILE="$APP_ROOT/FileBot.jar" echo "Update $JAR_FILE" -curl -L -o "$JAR_FILE" -z "$JAR_FILE" "http://sourceforge.net/projects/filebot/files/filebot/HEAD/FileBot.jar" +curl -L -o "$JAR_FILE" -z "$JAR_FILE" "http://sourceforge.net/projects/filebot/files/filebot/HEAD/FileBot.jar" \ No newline at end of file