aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-27 15:01:28 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-27 15:01:28 -0600
commit338af8653223b2505ebb9a5df0e69ff275d17af7 (patch)
treebeef43827d847df5f2a1317270d8e38887f9a5cb /src
parent7d633783c3f5bde724c14e93b6bb1aa261c80737 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'src')
-rw-r--r--src/src/nxmhandler_linux.cpp11
1 files changed, 10 insertions, 1 deletions
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);