MicrosoftGame.config: commented-out entries are not the game's #61

Merged
gefydev merged 1 commit from upstream-pr/62 into main 2026-11-23 10:20:31 +00:00
gefydev commented 2026-11-22 23:10:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-22T23:10:42Z.


launcher.rs reads MicrosoftGame.config by searching for tags in its text (xml_attrs), so a tag inside an XML comment counts like a real one:

  • <!--<Executable Name="old.exe" Id="Game"/>--> before the real entry: pick_exe launches old.exe if that file is in the folder (it takes the first listed exe that exists).
  • <!-- <Identity Name="Contoso.Old"/> --> before the real one: the title, and with it the data folder, gets the old name.
  • Same for ShellVisuals DefaultDisplayName (the window title).

decode_game_config now removes <!-- ... --> after decoding (an unterminated comment runs to the end of the file), so read_game_config, display_name and pick_exe only see live entries.

Validation

  • New test commented_out_entries_are_not_the_games: a config with a commented-out Identity, Executable and ShellVisuals, and both old.exe and game.exe in the folder. On main, read_game_config returns (["old.exe", "game.exe"], Some("Contoso.Old")); with the change it returns (["game.exe"], Some("Contoso.Test")), pick_exe picks game.exe and the display name is the live one.
  • cargo test -p xcl --lib: 344 passed, 0 failed, on Windows GNU under Wine.
<!-- greyfinch-sync:ivall/xcl:issue:6549043083 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/62). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-22T23:10:42Z. --- `launcher.rs` reads MicrosoftGame.config by searching for tags in its text (`xml_attrs`), so a tag inside an XML comment counts like a real one: - `<!--<Executable Name="old.exe" Id="Game"/>-->` before the real entry: `pick_exe` launches `old.exe` if that file is in the folder (it takes the first listed exe that exists). - `<!-- <Identity Name="Contoso.Old"/> -->` before the real one: the title, and with it the data folder, gets the old name. - Same for `ShellVisuals DefaultDisplayName` (the window title). `decode_game_config` now removes `<!-- ... -->` after decoding (an unterminated comment runs to the end of the file), so `read_game_config`, `display_name` and `pick_exe` only see live entries. ## Validation - New test `commented_out_entries_are_not_the_games`: a config with a commented-out Identity, Executable and ShellVisuals, and both `old.exe` and `game.exe` in the folder. On `main`, `read_game_config` returns `(["old.exe", "game.exe"], Some("Contoso.Old"))`; with the change it returns `(["game.exe"], Some("Contoso.Test"))`, `pick_exe` picks `game.exe` and the display name is the live one. - `cargo test -p xcl --lib`: 344 passed, 0 failed, on Windows GNU under Wine.
upstream-sync closed this pull request 2026-11-24 06:56:58 +00:00
ivall commented 2026-11-24 07:00:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T10:20:55Z.


Merged as part of #63 (5412c24). Tested on Windows 11 with an RX 9070: cargo test --workspace green with the retail samples (shader pack, console DLLs, texture archive), and Unicorn Overlord reaches its title screen with everything from this round merged. Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7097811822 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/62#issuecomment-7097811822). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T10:20:55Z. --- Merged as part of #63 (5412c24). Tested on Windows 11 with an RX 9070: `cargo test --workspace` green with the retail samples (shader pack, console DLLs, texture archive), and Unicorn Overlord reaches its title screen with everything from this round merged. Thanks!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!61
No description provided.