diff --git a/osx-app/Sonarr.app/Contents/Info.plist b/osx-app/Sonarr.app/Contents/Info.plist new file mode 100644 index 000000000..23f93ea6b --- /dev/null +++ b/osx-app/Sonarr.app/Contents/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + sonarr + CFBundleIconFile + sonarr.icns + CFBundleIdentifier + com.osx.sonarr.tv + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Sonarr + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.0 + CFBundleSignature + xmmd + CFBundleVersion + 2.0 + NSAppleScriptEnabled + NO + + \ No newline at end of file diff --git a/osx-app/Sonarr.app/Contents/Resources/sonarr.icns b/osx-app/Sonarr.app/Contents/Resources/sonarr.icns new file mode 100644 index 000000000..884633ff3 Binary files /dev/null and b/osx-app/Sonarr.app/Contents/Resources/sonarr.icns differ diff --git a/osx-app/Sonarr.app/MacOS/sonarr.sh b/osx-app/Sonarr.app/MacOS/sonarr.sh new file mode 100644 index 000000000..4fcf9e592 --- /dev/null +++ b/osx-app/Sonarr.app/MacOS/sonarr.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +#get the bundle's MacOS directory full path +DIR=$(cd "$(dirname "$0")"; pwd) + +#change these values to match your app +EXE_PATH="$DIR\nzbdrone.exe" +PROCESS_NAME=appname +APPNAME="Sonarr" + +#set up environment +MONO_FRAMEWORK_PATH=/Library/Frameworks/Mono.framework/Versions/Current +export DYLD_FALLBACK_LIBRARY_PATH="$DIR:$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib" +export PATH="$MONO_FRAMEWORK_PATH/bin:$PATH" + +#mono version check +REQUIRED_MAJOR=3 +REQUIRED_MINOR=10 + +VERSION_TITLE="Cannot launch $APPNAME" +VERSION_MSG="$APPNAME requires Mono Runtime Environment (MRE) version $REQUIRED_MAJOR.$REQUIRED_MINOR or later." +DOWNLOAD_URL="http://www.mono-project.com/download/#download-mac" + +MONO_VERSION="$(mono --version | grep 'Mono JIT compiler version ' | cut -f5 -d\ )" +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 + +#get an exec command that will work on the current OS version +OSX_VERSION=$(uname -r | cut -f1 -d.) +if [ $OSX_VERSION -lt 9 ]; then # If OSX version is 10.4 + MONO_EXEC="exec mono --debug" +else + MONO_EXEC="exec -a \"$PROCESS_NAME\" mono --debug" +fi + +#run app using mono +$MONO_EXEC --debug "$EXE_PATH" \ No newline at end of file