diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-15 13:02:29 -0600 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-15 13:02:29 -0600 |
| commit | 83eeb7926d3b734745dda39e50dda23dfe36ac66 (patch) | |
| tree | 3e93b64fdd25c9ea6900dbb0cb289c9ba9fc2446 /src | |
| parent | 987153bd3222c949edcabd7fbc5286a5228a0fe7 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/src/protonlauncher.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
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()) { |
