From 338af8653223b2505ebb9a5df0e69ff275d17af7 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Fri, 27 Feb 2026 15:01:28 -0600 Subject: Fix NXM handler for AppImage: use stable executable path The NXM handler wrapper script was using QCoreApplication::applicationFilePath() which returns the temporary FUSE mount path for AppImages (/tmp/.mount_FluoriXXXXXX/...). This path changes every launch and doesn't exist when the AppImage isn't running, breaking NXM downloads from Nexus. Now uses the APPIMAGE env var (the actual .AppImage file path on disk) which is stable across launches and always accessible. Fixes #20 Co-Authored-By: Claude Opus 4.6 --- src/src/nxmhandler_linux.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/src/nxmhandler_linux.cpp b/src/src/nxmhandler_linux.cpp index 1203585..3e18658 100644 --- a/src/src/nxmhandler_linux.cpp +++ b/src/src/nxmhandler_linux.cpp @@ -196,7 +196,16 @@ void NxmHandlerLinux::registerHandler() const } const QString wrapperPath = localBin + "/mo2-nxm-handler"; - const QString executable = QCoreApplication::applicationFilePath(); + + // Determine a stable executable path for the wrapper script. + // QCoreApplication::applicationFilePath() returns the temp FUSE mount for + // AppImages (/tmp/.mount_XXXXX/...) which changes every launch. Use the + // APPIMAGE env var (the actual .AppImage file) when available. + QString executable = qEnvironmentVariable("APPIMAGE"); + if (executable.isEmpty()) { + executable = QCoreApplication::applicationFilePath(); + } + const QString wrapper = QString("#!/bin/sh\nexec \"%1\" nxm-handle \"$@\"\n").arg(executable); -- cgit v1.3.1