feat(launcher): build the game from an ISO inside the launcher

Merged
NO
5d ago
+134-37

Summary

On Windows, setting up the game took two separate steps: drag the ISO onto BuildGame.cmd, watch a console window, then open Launcher.cmd to play. The launcher now does both. A new Build page lets you choose the ISO, press Build game, and follow the build output inside the launcher window. The main menu shows whether a build exists, and Play opens the Build page until one does.

 Launcher.cmd -> tools/launcher.ps1
   MAIN MENU    "Ready to play" | "Build the game first"
+  BUILD        ISO picker, Build game, live log
+                 cmd /c BuildGame.cmd <iso> > private/launcher-build.log < nul
+                 a 250 ms timer tails the log; when the build exits, the status refreshes
   GRAPHICS ... HELP   (unchanged, indexes shifted by one)
   PLAY         no build -> Build page; built -> save settings, RunGame.cmd
  • The build runs the existing BuildGame.cmd without a console window, so Python detection, the llvm-mingw download and receipts all work as before. Its NUL input lets the closing pause return.
  • "Built" uses the places RunGame.cmd checks: private/active-build.json, the older runner locations, or a setup-* receipt whose status is built-unverified. Failed attempts also write receipts, so the status matters. RunGame.cmd still validates the build before launch.
  • The launcher won't close while a build is running.
  • Menu spacing changes from 44 px to 38 px so all eight items fit above the footer.
  • BuildGame.cmd and RunGame.cmd still work for drag and drop. The README and docs/building.md now point to the launcher route first.

Verification

  • tools/test_launcher.ps1 passes in Windows PowerShell 5.1 and PowerShell 7.6.
  • I ran the exact command the Build button uses with a missing ISO at C:\No Such Dir\game (1).iso. The quoted path reached build_game.py, the error was written to the log, and the process exited with code 1 without waiting on pause.
  • I rendered the launcher offscreen in PowerShell 5.1. All eight menu items fit above the footer. With no build present, the main menu shows "Build the game first (Build page)", and the Build page shows the ISO picker, Build button and log box.
  • public-ci steps: unittest passed 65 tests with 1 skipped; public_export.py verify --require-public-tree and verify-archive passed; MSVC Debug ctest passed 51/51; llvm-mingw clang ctest passed 45/45.
  • Not run: a full ISO build started from the new button. Please play-test that path.

Merge Danger

Door: two-way. This only changes launcher UI and docs; build and run scripts are untouched.

Blast Radius: Windows launcher only. macOS and Linux launchers are unchanged.

Contribution checklist

  • The change follows AGENTS.md and CONTRIBUTING.md.
  • No XBE, generated game C, retail instruction bytes, extracted assets or
    filenames, saves, BIOS data, private paths, or run evidence are included.
  • Third-party material and its license are identified, if applicable.

Summary by cubic

The Windows launcher now builds the game from an ISO itself, replacing the two-step drag-onto-BuildGame.cmd then launch flow.

  • Adds a Build page with an ISO picker, Build button, and a live log that tails BuildGame.cmd output without a console window.
  • The main menu shows "Ready to play" or "Build the game first (Build page)" based on the same build markers RunGame.cmd checks; Play opens the Build page until a build exists.
  • The launcher refuses to close while a build is running; BuildGame.cmd and RunGame.cmd still work for drag and drop.
  • README and docs/building.md now describe the launcher route first.