fix(export): split exe path from embedded arguments to prevent double-quoting - #36
Open
hikaps wants to merge 4 commits into
Open
fix(export): split exe path from embedded arguments to prevent double-quoting#36hikaps wants to merge 4 commits into
hikaps wants to merge 4 commits into
Conversation
added 4 commits
August 6, 2026 12:21
…-quoting When a Playnite File action stores the full command line in the Path field (e.g. '"C:\Game\game.exe" -arg1 -arg2'), the exe and arguments end up bundled in the SteamShortcut.Exe field. The ToObject VDF quoting would then wrap the entire string in quotes, producing double-quoted output like '""C:\Game\game.exe" -arg1 -arg2"' which Steam cannot parse. Fix applies at three levels: - Utils.SplitExeAndArgs(): new helper extracts the quoted exe portion from a command line string - CreateOrUpdateShortcut + WriteBackHandler: split exe/args before setting sc.Exe; combine split args with action.Arguments for LaunchOptions - ToObject(): defense-in-depth guard against partially-quoted strings reaching the VDF serializer Closes #35
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.
Summary
Fixes #35 — when a Playnite File action stores the full command line in the
Pathfield (e.g."C:\Game\game.exe" -arg1 -arg2), the exe and arguments end up bundled inSteamShortcut.Exe. The VDF quoting logic inToObjectthen wraps the entire string again, producing double-quoted output like""C:\Game\game.exe" -arg1 -arg2"which Steam cannot parse.Root cause
The
alreadyQuotedcheck inToObjectonly handled fully-quoted strings (starts AND ends with"). A partially-quoted string like"C:\Game\game.exe" -argspasses through and gets wrapped:""C:\Game\game.exe" -args".Changes
Three layers of defense:
Utils.SplitExeAndArgs(string)— new helper that detects when a command line has a quoted exe portion followed by arguments, and splits them apart.CreateOrUpdateShortcut+WriteBackHandler— split exe/args before settingsc.Exe; combine split args withaction.Argumentsforsc.LaunchOptions. Also fixesappIdgeneration to use the clean exe path.ToObject()defense-in-depth — even if a partially-quoted exe slips through, extract only the quoted portion instead of re-wrapping the entire string.Tests
SplitExeAndArgs: 7 unit tests covering quoted+args, quoted-only, unquoted, unmatched quotes, whitespace, empty inputToObject: 6 regression tests covering the exact double-quoting scenario, already-quoted, unquoted, unmatched quote, empty/whitespaceFiles
src/SteamShortcutsImporter/Utils.csSplitExeAndArgssrc/SteamShortcutsImporter/ImportExportService.cssrc/SteamShortcutsImporter/WriteBackHandler.cssrc/SteamShortcutsImporter/ShortcutsFile.cstests/ShortcutsTests/UtilsTests.cstests/ShortcutsTests/ShortcutsFileTests.cs