feat: auto-set Steam Launch Options after MelonLoader install#6
Open
kkorenn wants to merge 1 commit into
Open
Conversation
Until now the app only showed a guide telling users to paste "setup_helper.sh" %command% into Steam's per-game Launch Options by hand. Port the targeted localconfig.vdf editor from the reference Swift installer (sbrothers7/UMMInstall) to Dart so the wrapper is wired up automatically on install and cleared on uninstall. - steam_config.dart: cross-platform (macOS/Linux/Windows) localconfig.vdf reader/editor. Does a scoped, backup-first, atomic edit of the apps -> <appid> -> LaunchOptions value rather than re-serializing, so the rest of the file is preserved. Brace/quote-aware scan handles nested blocks and escaped quotes; clear() only removes our own wrapper so a user's custom launch options are left untouched. - Game.steamLaunchOptionsValue()/isProtonOrWineInstall(): compute the correct value per game + platform (macOS absolute path, Linux native relative path, Proton/Wine WINEDLLOVERRIDES). Windows = none. - InstallerState: apply after a successful install, clear on uninstall, surface an auto-set confirmation (with a "restart Steam" hint when Steam is running) above the existing manual guide, which stays as a fallback. - Localization for ko-KR / en-US / zh-CN. - Unit tests for the VDF editor (set/insert/scope/case/escaping/clear). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
After a MelonLoader install, the app now writes the required Steam Launch Options automatically instead of only showing a guide and asking the user to paste
"…/setup_helper.sh" %command%by hand. It's cleared again on uninstall.Ported the targeted
localconfig.vdfeditor from the reference Swift installer (sbrothers7/UMMInstall —SteamConfig.swift) to cross-platform Dart.How
lib/src/core/steam_config.dart(new): finds everyuserdata/<id>/config/localconfig.vdfacross detected Steam roots (macOS/Linux/Windows) and does a scoped, backup-first, atomic edit ofapps → <appid> → LaunchOptions— no full re-serialize, so the rest of the file is preserved byte-for-byte. The scan is brace/quote-aware (handles nested blocks and\"-escaped values).clear()only blanks the value when it still references one of our wrappers, so a user's own custom launch options are never touched.Game.steamLaunchOptionsValue()/isProtonOrWineInstall(): compute the correct value per game + platform — macOS native (absolute script path), Linux native (./setup_helper.sh %command%), Proton/Wine (WINEDLLOVERRIDES="winhttp=n,b" %command%), Windows (none).InstallerState: applies after a successful install, clears on uninstall, and exposes flags so the UI shows an auto-set confirmation (with a "fully restart Steam" hint when Steam is running, since Steam rewriteslocalconfig.vdfon exit). The existing manual guide stays as a fallback.ko-KR/en-US/zh-CN.Safety / fallback
localconfig.vdf, write error) is logged and the manual guide remains the fallback — install never fails because of this..modlist.bakbackup is written before each edit.steamAppId(ADOFAI977950, Rhythm Doctor774181, Dancing Line4395300).Tests
test/steam_config_test.dart— 17 cases covering the pure VDF editor: replace/insert LaunchOptions, insert a missing app block,apps-scoping vs decoys, case-insensitivity, escaped-quote handling, and the clear-only-our-wrapper rule. Full suite green (flutter test, 25 passing).Note
Heads-up for maintainers: writing into
localconfig.vdfonly sticks if Steam is fully quit; the code detects a running Steam and surfaces a restart hint. Worth a manual smoke-test on each platform.🤖 Generated with Claude Code