Skip to content

fix(launcher): improve game path auto detection#292

Merged
lshw54 merged 1 commit into
codefrom
issue-284-game-path-auto-detect
May 27, 2026
Merged

fix(launcher): improve game path auto detection#292
lshw54 merged 1 commit into
codefrom
issue-284-game-path-auto-detect

Conversation

@lshw54
Copy link
Copy Markdown
Collaborator

@lshw54 lshw54 commented May 27, 2026

What

Game path auto-detection could fail when the INI registry path pointed at HKEY_LOCAL_MACHINE, because the launcher stripped the HKLM prefix and only read HKCU. Users then had to manually choose the game executable even when the install path was available from registry or a standard install location.

Fix

Teach detect_game_path to build registry lookup candidates from the INI hive prefix.

Explicit HKEY_LOCAL_MACHINE paths now read HKLM first, with HKCU as a compatibility fallback. Explicit HKEY_CURRENT_USER paths read HKCU, while unprefixed paths keep the historical HKCU-first behavior and then try HKLM.

If registry detection still returns empty, fall back to common Program Files install paths using the INI executable template to derive the game exe name. Successful registry or default-path detections are written back to Config.xml for future launches.

Updates frontend callers to pass the INI exe template, regenerates bindings, and adds regression coverage for HKLM-prefixed registry detection plus default install-path candidate generation.

Closes #284

@lshw54 lshw54 self-assigned this May 27, 2026
@lshw54 lshw54 merged commit e41c0d7 into code May 27, 2026
3 checks passed
@lshw54 lshw54 deleted the issue-284-game-path-auto-detect branch May 27, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 遊戲路徑未能自動偵測 / Game Path Not Auto-detected

1 participant