From c360dbf9c42f71e7931c56b7a396ba7f7e9982e6 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Mon, 23 Feb 2026 17:44:12 -0600 Subject: Remove umu-run, keep game as child process for Steam tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove umu-run entirely (crashed due to pressure-vessel/FUSE incompatibility) — use raw `proton run` instead - Replace startDetached() with QProcess::start() so the game stays in Fluorine's process tree. This lets Steam track the game lifetime and makes the "close game" button work when Fluorine is added as a non-Steam game. - Add writeIniValueDirect/readIniValueDirect for safe Bethesda INI handling without QSettings corruption - Fix prefix_setup.rs to skip umu-run bootstrapping - Clean up settings UI, build scripts, and docs for umu-run removal Co-Authored-By: Claude Opus 4.6 --- libs/uibase/src/registry.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) (limited to 'libs/uibase/src/registry.cpp') diff --git a/libs/uibase/src/registry.cpp b/libs/uibase/src/registry.cpp index 0b6834f..5832075 100644 --- a/libs/uibase/src/registry.cpp +++ b/libs/uibase/src/registry.cpp @@ -174,6 +174,87 @@ bool WriteRegistryValue(const QString& appName, const QString& keyName, return false; } +bool RemoveRegistryValue(const QString& section, const QString& key, + const QString& fileName) +{ + if (!QFileInfo::exists(fileName)) { + return true; // nothing to remove + } + + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + return false; + } + QStringList lines; + QTextStream in(&file); + while (!in.atEnd()) { + lines.append(in.readLine()); + } + file.close(); + + const QString sectionHeader = "[" + section + "]"; + int sectionStart = -1; + int sectionEnd = lines.size(); + + for (int i = 0; i < lines.size(); ++i) { + QString trimmed = lines[i].trimmed(); + if (trimmed.compare(sectionHeader, Qt::CaseInsensitive) == 0) { + sectionStart = i; + for (int j = i + 1; j < lines.size(); ++j) { + QString t = lines[j].trimmed(); + if (t.startsWith('[') && t.endsWith(']')) { + sectionEnd = j; + break; + } + } + break; + } + } + + if (sectionStart < 0) { + return true; // section not found, nothing to remove + } + + // Find and remove the key line + bool found = false; + for (int i = sectionStart + 1; i < sectionEnd; ++i) { + QString trimmed = lines[i].trimmed(); + if (trimmed.isEmpty() || trimmed.startsWith(';') || trimmed.startsWith('#')) { + continue; + } + int eqPos = trimmed.indexOf('='); + if (eqPos > 0) { + QString existingKey = trimmed.left(eqPos).trimmed(); + if (existingKey.compare(key, Qt::CaseInsensitive) == 0) { + lines.removeAt(i); + found = true; + break; + } + } + } + + if (!found) { + return true; // key not found, nothing to remove + } + + // Write back + QFile outFile(fileName); + if (!outFile.open(QIODevice::WriteOnly | QIODevice::Text)) { + return false; + } + QTextStream out(&outFile); + for (int i = 0; i < lines.size(); ++i) { + out << lines[i]; + if (i < lines.size() - 1) { + out << '\n'; + } + } + out << '\n'; + outFile.close(); + + return true; +} + #ifdef _WIN32 bool WriteRegistryValue(const wchar_t* appName, const wchar_t* keyName, const wchar_t* value, const wchar_t* fileName) -- cgit v1.3.1