From 0bd0c91c25e0d9923b44b728ee7782a7f03e69e5 Mon Sep 17 00:00:00 2001 From: ciscon Date: Tue, 21 Nov 2023 13:09:17 -0500 Subject: [PATCH] BUILD: appimage - fix path to appimage if we've used that for qwurl registration --- misc/appimage/appimage-manual_creation.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/misc/appimage/appimage-manual_creation.sh b/misc/appimage/appimage-manual_creation.sh index 82be59b97..526887741 100755 --- a/misc/appimage/appimage-manual_creation.sh +++ b/misc/appimage/appimage-manual_creation.sh @@ -42,12 +42,22 @@ cd "$OWD" FAIL=${PIPESTATUS[0]} if [ $FAIL -eq 0 ];then echo "executing with native libc" - exec "${APPDIR}/usr/bin/ezquake-linux-'$ARCH'" $* + "${APPDIR}/usr/bin/ezquake-linux-'$ARCH'" $* else echo "executing with appimage libc" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${APPDIR}/usr/lib-override" - exec "${APPDIR}/usr/lib-override/ld-linux-'$ARCHDASH'.so.2" "${APPDIR}/usr/bin/ezquake-linux-'$ARCH'" $* -fi' + "${APPDIR}/usr/lib-override/ld-linux-'$ARCHDASH'.so.2" "${APPDIR}/usr/bin/ezquake-linux-'$ARCH'" $* +fi +exitstatus=$? + +if [ $exitstatus -eq 0 ];then + #fix qwurl association if set for appimage + grep -q "^Exec=/tmp/.mount_ezq" "${HOME}/.local/share/applications/qw-url-handler.desktop" && \ + sed -i "s|^Exec=.*|Exec=${APPIMAGE}|g" "${HOME}/.local/share/applications/qw-url-handler.desktop" +else + exit $exitstatus +fi +' unset CC if [ "$ARCH" == "x86_64" ];then