first cut at turnon scripts for EasyTimer v2
[fw/altos] / telegps / TeleGPS.app / Contents / MacOS / JavaApplicationStub
index f4a577e088e11c9860e4414f6645890224c24a28..9b7cb7078bce137d5889192008cc186c651c899e 100755 (executable)
 #                                                                                #
 ##################################################################################
 
-
+#
+# Fix fonts. I don't know why the getting the
+# basename of the app set to . matters, but it does
+#
+case "$0" in
+    /*)
+        cd `dirname "$0"`
+        ./`basename "$0"` "$@"
+        exit $?
+        ;;
+esac
+export FREETYPE_PROPERTIES=truetype:interpreter-version=35
 
 # function 'stub_logger()'
 #
@@ -382,7 +393,7 @@ fr)
        MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..."
        MSG_LATER="Plus tard"
        MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
-       MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
+       MSG_VISIT_ADOPTIUM="Java by Adoptium"
     ;;
 
 # German
@@ -398,7 +409,7 @@ de)
        MSG_INSTALL_JAVA="Auf Ihrem System muss die 'Java'-Software installiert sein.\nBesuchen Sie java.com für weitere Installationshinweise."
        MSG_LATER="Später"
        MSG_VISIT_JAVA_DOT_COM="Java von Oracle"
-       MSG_VISIT_ADOPTOPENJDK="Java von AdoptOpenJDK"
+       MSG_VISIT_ADOPTIUM="Java von Adoptium"
     ;;
 
 # Simplified Chinese
@@ -414,7 +425,7 @@ zh)
        MSG_INSTALL_JAVA="你需要在Mac中安装Java运行环境!\n访问 java.com 了解如何安装。"
        MSG_LATER="稍后"
        MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
-       MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
+       MSG_VISIT_ADOPTIUM="Java by Adoptium"
     ;;
 
 # Spanish
@@ -430,7 +441,7 @@ es)
        MSG_INSTALL_JAVA="¡Necesita tener JAVA instalado en su Mac!\nVisite java.com para consultar las instrucciones para su instalación..."
        MSG_LATER="Más tarde"
        MSG_VISIT_JAVA_DOT_COM="Java de Oracle"
-       MSG_VISIT_ADOPTOPENJDK="Java de AdoptOpenJDK"
+       MSG_VISIT_ADOPTIUM="Java de Adoptium"
     ;;
 
 # English | default
@@ -446,7 +457,7 @@ en|*)
        MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..."
        MSG_LATER="Later"
        MSG_VISIT_JAVA_DOT_COM="Java by Oracle"
-       MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
+       MSG_VISIT_ADOPTIUM="Java by Adoptium"
     ;;
 esac
 
@@ -792,7 +803,13 @@ fi
 stub_logger "[JavaCommand] '$JAVACMD'"
 stub_logger "[JavaVersion] $(get_java_version_from_cmd "${JAVACMD}")${JAVACMD_version:+ / $JAVACMD_version}"
 
+# Make sure tabbing mode is disabled for the selected java version
+
+CFBundleIdentifier=net.java.openjdk.$(get_java_version_from_cmd "${JAVACMD}").java
 
+if [ x$(defaults read ${CFBundleIdentifier} AppleWindowTabbingMode) != "xnever" ]; then
+    defaults write ${CFBundleIdentifier} AppleWindowTabbingMode never
+fi
 
 if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then
 
@@ -812,10 +829,10 @@ if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then
                stub_logger "[EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}"
 
                # display error message with AppleScript
-               osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\"  buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
+               osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\"  buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTIUM}\"} default button 1${DialogWithIcon}" \
                                -e "set response to button returned of the result" \
                                -e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
-                               -e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
+                               -e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
                # exit with error
                exit 3
 
@@ -823,10 +840,10 @@ if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then
                # log exit cause
                stub_logger "[EXIT 1] ${MSG_ERROR_LAUNCHING}"
                # display error message with AppleScript
-               osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \
+               osascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTIUM}\"} default button 1${DialogWithIcon}" \
                                        -e "set response to button returned of the result" \
                                        -e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \
-                                       -e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""
+                                       -e "if response is \"${MSG_VISIT_ADOPTIUM}\" then open location \"https://adoptium.net/releases.html\""
                # exit with error
                exit 1
        fi
@@ -877,6 +894,7 @@ stub_logger "[WorkingDirectory] ${WorkingDirectory}"
 # - passthrough arguments from Terminal or Drag'n'Drop to Finder icon
 stub_logger "[Exec] \"$JAVACMD\" -cp \"${JVMClassPath}\" ${JVMSplashFile:+ -splash:\"${ResourcesFolder}/${JVMSplashFile}\"} -Xdock:icon=\"${ResourcesFolder}/${CFBundleIconFile}\" -Xdock:name=\"${CFBundleName}\" ${JVMOptionsArr:+$(printf "'%s' " "${JVMOptionsArr[@]}") }${JVMDefaultOptions:+$JVMDefaultOptions }${JVMMainClass}${MainArgsArr:+ $(printf "'%s' " "${MainArgsArr[@]}")}${ArgsPassthru:+ $(printf "'%s' " "${ArgsPassthru[@]}")}"
 exec "${JAVACMD}" \
+               -Djava.library.path="${AppleJavaFolder}" \
                -cp "${JVMClassPath}" \
                ${JVMSplashFile:+ -splash:"${ResourcesFolder}/${JVMSplashFile}"} \
                -Xdock:icon="${ResourcesFolder}/${CFBundleIconFile}" \