From 83eeb7926d3b734745dda39e50dda23dfe36ac66 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Sun, 15 Feb 2026 13:02:29 -0600 Subject: Fix system umu-run detection finding bundled copy instead The launcher script prepends the app directory to PATH, so QStandardPaths::findExecutable found the bundled umu-run as the "system" one. Now explicitly filters out the app directory when searching PATH for a true system-installed umu-run. Co-Authored-By: Claude Opus 4.6 --- src/src/protonlauncher.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/src/protonlauncher.cpp b/src/src/protonlauncher.cpp index 6a1aecd..6497fff 100644 --- a/src/src/protonlauncher.cpp +++ b/src/src/protonlauncher.cpp @@ -378,9 +378,25 @@ bool ProtonLauncher::launchWithUmu(qint64& pid) const umuRun = QStringLiteral("umu-run"); } } else { - const QString bundled = - QCoreApplication::applicationDirPath() + QStringLiteral("/umu-run"); - const QString system = QStandardPaths::findExecutable(QStringLiteral("umu-run")); + const QString appDir = QCoreApplication::applicationDirPath(); + const QString bundled = appDir + QStringLiteral("/umu-run"); + + // Search PATH for a system umu-run, excluding our own app directory + // (the launcher prepends it to PATH, so findExecutable would find the + // bundled copy otherwise). + QString system; + const QStringList pathDirs = + QString::fromLocal8Bit(qgetenv("PATH")).split(QLatin1Char(':'), Qt::SkipEmptyParts); + for (const QString& dir : pathDirs) { + if (QDir(dir) == QDir(appDir)) + continue; + const QString candidate = QStandardPaths::findExecutable( + QStringLiteral("umu-run"), {dir}); + if (!candidate.isEmpty()) { + system = candidate; + break; + } + } if (m_preferSystemUmu) { if (!system.isEmpty()) { -- cgit v1.3.1