From b1b4b5d38a3e2424785193f81b50941f32ca97ea Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Sat, 29 Nov 2025 14:13:51 -0500 Subject: [PATCH] fix(launcher): set correct bin path for self-contained appimages Signed-off-by: Seth Flynn --- launcher/Application.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 9576ae695..0ed1cc71d 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -371,7 +371,25 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv) } QString origcwdPath = QDir::currentPath(); +#if defined(Q_OS_LINUX) + const QString binFilePath = applicationFilePath(); + const bool isAppImage = binFilePath.startsWith("/tmp/.mount_"); + // Yes, this can technically trigger the logic below if someone makes an AppImage with an actual launcher exe named "ld-linux" + // Please don't :) + const bool executedFromLinker = QFileInfo(binFilePath).fileName().startsWith("ld-linux"); + + // NOTE(@getchoo): In order for `go-appimage` to generate self-contained AppImages, it executes apps from a bundled linker at + // /lib64 + // This is not the path to our actual binary, which we want + QString binPath; + if (isAppImage && executedFromLinker) { + binPath = FS::PathCombine(applicationDirPath(), "../usr/bin"); + } else { + binPath = applicationDirPath(); + } +#else QString binPath = applicationDirPath(); +#endif { // Root path is used for updates and portable data