run the game from inside the prefix, so it can save a replay

`Run-time error '76': Path not found` on finishing a game. Error 76 is VB6's
"path not found", and the path it could not find was the game's own.

Confining the prefix removed `z:`, which left `C:` as the only drive — and the
executable was in the plugin checkout, which `C:` does not cover. So wine gave
the game `\\?\unix\home\pastilhas\...\Minesweeper X.exe` as its own location
(confirmed with `winepath`), VB6 file I/O cannot write to a path of that shape,
and the first thing that needs to is the auto-saved recording. Which happens at
the END of a game, so the failure arrived after somebody had played.

The comment in prefix.ts already claimed "the game keeps its own directory, its
settings and its replays". It did not. It does now: `installGame` copies the
68 KB executable into `C:\Minesweeper` on every start and the game runs from
there, with cwd set to match so relative writes stop landing in C:\windows.

Copied rather than symlinked — a symlink out of drive_c is a door out of the
prefix, which is the exact thing confinePrefix exists to close. The cost is
that replays now live inside prefix/, so deleting it to unwedge wine takes them
along; that is in the README rather than left to be discovered.

Verified end to end rather than by inspection: set Auto-Save Recording to All,
played a beginner game to a loss, and
`Beg 1.16 - Aug 23 2026 22.09.18 PM (Lost).mvr` appeared in C:\Minesweeper.
Before this, that same moment was the error box. The default is "High scores",
which is why an ordinary losing game never reproduced it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: de3ed4e6-f88a-429c-94e6-a760336ba83b
This commit is contained in:
2026-08-23 22:10:30 +00:00
co-authored by Claude Opus 5
parent 26c8dd3e1a
commit 105068170c
4 changed files with 68 additions and 12 deletions
+19 -2
View File
@@ -38,10 +38,27 @@ The download needs a browser `User-Agent`; the site answers `403` to curl's defa
`DATA_PATH/minesweeper/` — never in this directory, which `plugins:update` will `git pull` over.
- `prefix/` — the wine prefix, ~600 MB, built on first `POST /start`. Deleting it is the standard fix for
a wedged wine, and it is safe: the next start rebuilds it.
- `prefix/` — the wine prefix, ~600 MB, built on first `POST /start`. Deleting it is still the standard fix
for a wedged wine and the next start rebuilds it — but it now takes the replays with it, see below.
- `prefix/drive_c/Minesweeper/` — where the game RUNS from, and where its replays land. The executable is
copied here on every start; `C:` is the only drive the prefix has, so this is the only directory the game
has a writable path to. Launched from the plugin checkout instead, its own path came back as
`\\?\unix\home\…` and finishing a game raised `Run-time error '76': Path not found` while it tried to
auto-save the recording.
- `run/` — pid state, logs, and `vnc.sock`. **Mode 0700, and that is load-bearing.**
## Two gaps, both from having no window manager
Worth knowing before you conclude something is broken. Neither is hard to fix; neither is fixed.
**Some dialogs cannot be closed.** There is no window manager, so no window has a title bar. A dialog with
its own OK button is fine — the run-time error box is — but Extras → Auto Options has neither an OK button
nor a Cancel, and its only exit was the title bar. Restarting the sidecar clears it.
**The panel sends no keyboard events at all.** `MinesweeperPanel` forwards pointer events and nothing else,
so Escape does not reach the game and a Custom board cannot be typed in. Adding keys to the RFB client is
the smaller half of this; wine also expects a window manager to hand it focus.
## Two things worth knowing before you change anything
**x11vnc has no password, and that is correct — but only because it also has no port.** It binds a unix