From 3724218a2d7a23a49a231b767d902085e2b65aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20H=C3=B6binger?= Date: Wed, 22 Jul 2026 13:05:33 +0200 Subject: [PATCH] fix: quote $BASEDIR in launcher scripts to support paths with spaces The macOS and Linux launcher scripts fail when the application is installed on a path containing spaces (e.g. /Volumes/External Apps/). The unquoted $BASEDIR variable undergoes word splitting, causing the shell to interpret the path fragment before the space as the executable name, resulting in 'No such file or directory'. Fix by quoting "$BASEDIR/jre/bin/java" in both scripts. Also modernize the Linux script to use $(dirname ...) with proper quoting instead of backticks. --- pdf-over-gui/src/main/resources/scripts/pdf-over_linux.sh | 4 ++-- pdf-over-gui/src/main/resources/scripts/pdf-over_mac.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pdf-over-gui/src/main/resources/scripts/pdf-over_linux.sh b/pdf-over-gui/src/main/resources/scripts/pdf-over_linux.sh index 9f8f2776..56c13361 100644 --- a/pdf-over-gui/src/main/resources/scripts/pdf-over_linux.sh +++ b/pdf-over-gui/src/main/resources/scripts/pdf-over_linux.sh @@ -1,3 +1,3 @@ #!/bin/sh -BASEDIR=`dirname $0` -GDK_BACKEND=x11,wayland exec $BASEDIR/jre/bin/java -cp "$BASEDIR/lib/*" at.asit.pdfover.gui.Main "$@" +BASEDIR=$(cd "$(dirname "$0")"; pwd) +GDK_BACKEND=x11,wayland exec "$BASEDIR/jre/bin/java" -cp "$BASEDIR/lib/*" at.asit.pdfover.gui.Main "$@" diff --git a/pdf-over-gui/src/main/resources/scripts/pdf-over_mac.sh b/pdf-over-gui/src/main/resources/scripts/pdf-over_mac.sh index 59a1f73b..6da56788 100644 --- a/pdf-over-gui/src/main/resources/scripts/pdf-over_mac.sh +++ b/pdf-over-gui/src/main/resources/scripts/pdf-over_mac.sh @@ -1,4 +1,4 @@ #!/bin/sh BASEDIR=$(cd "$(dirname "$0")"; pwd) export LC_CTYPE="UTF-8" -exec $BASEDIR/jre/bin/java -XstartOnFirstThread -cp "$BASEDIR/lib/*" at.asit.pdfover.gui.Main "$@" +exec "$BASEDIR/jre/bin/java" -XstartOnFirstThread -cp "$BASEDIR/lib/*" at.asit.pdfover.gui.Main "$@"