Skip to content

U-1: run scripts offer to find the game folder and take a dragged-in exe - #29

Merged
ShinniUwU merged 1 commit into
mainfrom
feat/game-dir-detect
Nov 26, 2026
Merged

ShinniUwU merged 1 commit into
mainfrom
feat/game-dir-detect

Conversation

@ShinniUwU

Copy link
Copy Markdown
Contributor

Follow-up to #28, helps U-1 (no terminal knowledge needed); does not finish it, so the TODO row stays.

When no game folder is saved yet, run-gta6.ps1 and measure-gta6.ps1 now offer to find the game instead of asking for a path straight away.

What changed

  • scripts/game-dir.ps1 (new, shared by both run scripts):
    • Asks "Look for your copy of the game on this PC automatically? [Y/n]".
    • On yes, looks for folders with a MicrosoftGame.config: up to 4 levels on every fixed drive (Windows' own folders skipped), deeper in Downloads, Desktop and Documents and the usual Xbox, Steam and Epic folders. Stops after 60 s.
    • One found: shows its name (from MicrosoftGame.config) and folder and asks to confirm. Several: numbered list, games named GTA first. None: says so.
    • On no, a rejected match or nothing found: asks for the folder, with a tip to drag the game's .exe (or its folder) from File Explorer into the window, or paste the address bar.
    • The answer doesn't have to be exact: a dragged-in .exe (& '...' or "..."), a file in a subfolder, a folder up to 3 levels above, or the folder holding Content all resolve to the game folder. It asks again until one has a MicrosoftGame.config.
  • run-gta6.ps1, measure-gta6.ps1: the old prompt loop is replaced by Read-GameDir; header comments updated. -GameDir and a saved folder work as before.
  • README: step 3 of the beginner steps explains auto-detect and drag-and-drop.

Tested

Windows 11 Pro 25H2, Ryzen 7 7800X3D, RTX 3080 12 GB, driver 621.24.

  • All three scripts parse with no errors in Windows PowerShell 5.1, CRLF line endings.
  • Real scan on this PC: found the game in 0.2 s and showed it as "Grand Theft Auto VI". Also run by hand: y, y returned the right folder.
  • Path resolving with a made-up game folder: dragged-in .exe in both forms, a file in a subfolder and the folder above all resolved; a wrong path and an empty answer were rejected.
  • Dry run of Read-GameDir with scripted answers: detect and accept; skip and drag in the .exe; detect, reject, wrong path, then the right folder.
  • cargo xtask policy: ok.
  • Not tested: a full run with the game through start-measure.cmd, or a PC where the game is deeper than the scan goes (the drag-and-drop prompt covers that).

AI-assisted.

🤖 Generated with Claude Code

@ShinniUwU
ShinniUwU merged commit 03ea39f into main Nov 26, 2026
1 check failed
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.

1 participant