NetHack 3.4.3 for Windows

This target is the native Win32 graphical build, NetHackW.exe, from the official NetHack 3.4.3 package. The official download page identifies this package for Windows 95/98 as well as later Windows versions. It is not a DOS build.

Original package

The archive contains the graphical and console executables plus 11 companion files. It has no installer: its own README instructs users to unzip every file into one directory. The candidate fetch recipe performs that documented installation step on the unchanged official ZIP.

The included NetHack General Public License permits verbatim redistribution when the copyright, warranty, and license notices remain intact and the stated source-access conditions are met. The Sources page links the official package; the fetched runtime remains a local, gitignored compatibility fixture.

Compatibility fixes

NetHack opens files using drive-relative names such as C:defaults.nh and C:user-Codex.0. Win32 resolves these against that drive's current directory. The VFS previously treated the colon-relative spelling as a literal path, so it could not find files mounted at C:\.

After that path fix, a missing save file still produced NetHack's Bad directory or name error. CreateFileA/W returned INVALID_HANDLE_VALUE but left GetLastError() at zero. The statically linked CRT translated that stale value to EINVAL. Failed opens now publish ERROR_FILE_NOT_FOUND, allowing the normal new-game path to continue.

The app also needs HACKDIR=C:\. Registered app environments are now applied before DLL loading in both browser guest modes and by the CLI. An explicit CLI --env value overrides the registered default.

Gameplay gate

The gate selects a random character, dismisses the release notes and character story, captures the tile dungeon, then sends cursor movement and requires a pixel change inside the map. It launches one frozen CLI process, controls it by streaming JSON over stdio, and relies on the CLI's own --max-seconds guard.

node tools/fetch-candidate-corpus.js --id=nethack-win32
bash tools/build.sh
NETHACK_SCREENSHOT=/private/tmp/nethack-gameplay.png \
  node test/test-nethack-win32.js

2026-10-10: movement and turns verified; paints, not frames

This build runs with number_pad on: letters are commands (l asks "Loot in what direction?" and then shows the direction help) and digits move. After the gate's three clicks (Dlvl 1, T:1 at batch 620, 25,000-block batches), typing 6 three times (keydown + char + keyup) walks the Ranger to the east wall, picks up "g - a whistle" and advances T:1 -> T:4. The gate's arrow-key check only proves the cursor moved, not a turn. Evidence: scratch/runs/20261010T0720Z-nethack-control-paints.

NetHack repaints on demand per child window: across those 3 turns, 11 BeginPaint/EndPaint cycles (map 0x10003 x6, status 0x10004 x4, message 0x10002 x1), tiles drawn with 38 StretchBlt and 14 masked BitBlt. Measure turns and paints; there is no frame loop.