You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.1 KiB
63 lines
2.1 KiB
10 years ago
|
#!/bin/sh
|
||
9 years ago
|
|
||
10 years ago
|
#get the bundle's MacOS directory full path
|
||
|
DIR=$(cd "$(dirname "$0")"; pwd)
|
||
9 years ago
|
|
||
10 years ago
|
#change these values to match your app
|
||
8 years ago
|
EXE_PATH="$DIR/Lidarr.exe"
|
||
|
APPNAME="Lidarr"
|
||
10 years ago
|
|
||
|
#set up environment
|
||
9 years ago
|
if [[ -x '/opt/local/bin/mono' ]]; then
|
||
6 years ago
|
# Macports and mono-supplied installer path
|
||
9 years ago
|
export PATH="/opt/local/bin:$PATH"
|
||
6 years ago
|
elif [[ -x '/usr/local/bin/mono' ]]; then
|
||
|
# Homebrew-supplied path to mono
|
||
|
export PATH="/usr/local/bin:$PATH"
|
||
9 years ago
|
fi
|
||
|
|
||
|
export DYLD_FALLBACK_LIBRARY_PATH="$DIR"
|
||
|
|
||
|
if [ -e /Library/Frameworks/Mono.framework ]; then
|
||
|
MONO_FRAMEWORK_PATH=/Library/Frameworks/Mono.framework/Versions/Current
|
||
|
export PATH="$MONO_FRAMEWORK_PATH/bin:$PATH"
|
||
|
export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$MONO_FRAMEWORK_PATH/lib"
|
||
|
fi
|
||
|
|
||
|
if [[ -f '/opt/local/lib/libsqlite3.0.dylib' ]]; then
|
||
|
export DYLD_FALLBACK_LIBRARY_PATH="/opt/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
|
||
|
fi
|
||
|
|
||
|
export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$HOME/lib:/usr/local/lib:/lib:/usr/lib"
|
||
|
|
||
10 years ago
|
#mono version check
|
||
6 years ago
|
REQUIRED_MAJOR=4
|
||
|
REQUIRED_MINOR=6
|
||
10 years ago
|
|
||
|
VERSION_TITLE="Cannot launch $APPNAME"
|
||
10 years ago
|
VERSION_MSG="$APPNAME requires Mono Runtime Environment(MRE) $REQUIRED_MAJOR.$REQUIRED_MINOR or later."
|
||
10 years ago
|
DOWNLOAD_URL="http://www.mono-project.com/download/#download-mac"
|
||
|
|
||
|
MONO_VERSION="$(mono --version | grep 'Mono JIT compiler version ' | cut -f5 -d\ )"
|
||
9 years ago
|
# if [[ -o DEBUG ]]; then osascript -e "display dialog \"MONO_VERSION: $MONO_VERSION\""; fi
|
||
|
|
||
|
|
||
10 years ago
|
MONO_VERSION_MAJOR="$(echo $MONO_VERSION | cut -f1 -d.)"
|
||
|
MONO_VERSION_MINOR="$(echo $MONO_VERSION | cut -f2 -d.)"
|
||
|
if [ -z "$MONO_VERSION" ] \
|
||
|
|| [ $MONO_VERSION_MAJOR -lt $REQUIRED_MAJOR ] \
|
||
|
|| [ $MONO_VERSION_MAJOR -eq $REQUIRED_MAJOR -a $MONO_VERSION_MINOR -lt $REQUIRED_MINOR ]
|
||
|
then
|
||
|
osascript \
|
||
|
-e "set question to display dialog \"$VERSION_MSG\" with title \"$VERSION_TITLE\" buttons {\"Cancel\", \"Download...\"} default button 2" \
|
||
|
-e "if button returned of question is equal to \"Download...\" then open location \"$DOWNLOAD_URL\""
|
||
|
echo "$VERSION_TITLE"
|
||
|
echo "$VERSION_MSG"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
10 years ago
|
MONO_EXEC="exec mono --debug"
|
||
10 years ago
|
|
||
|
#run app using mono
|
||
8 years ago
|
$MONO_EXEC "$EXE_PATH"
|