feat(release): support Windows #108

Merged
deadstyle merged 6 commits from feature/99-windows-support into develop 2026-10-09 12:02:09 -05:00
Owner

Summary

Windows build and install path for lazyforge: release zips for windows/amd64 and windows/arm64, a PowerShell installer, working self-update, and the platform bits that assumed Linux or macOS.

Changes

  • make release also builds lazyforge_<tag>_windows_{amd64,arm64}.zip (single entry lazyforge.exe); checksums.txt lists all six archives.
  • install.ps1: picks the arch, verifies the SHA-256, installs to %LOCALAPPDATA%\Programs\lazyforge, adds it to the user PATH (and broadcasts the change). Re-running upgrades in place, renaming a running exe aside if needed.
  • Self-update: Apply downloads and extracts the zip on Windows. The restart is now restart() in build-tagged files: syscall.Exec on Unix, a child process with stdio and exit code forwarded on Windows.
  • Config and state live under %AppData%\lazyforge on Windows (XDG overrides still win).
  • openBrowser uses rundll32 url.dll,FileProtocolHandler; the $EDITOR fallback is notepad; token_cmd runs through cmd /C.
  • make check gains vet-windows (vet and build both Windows targets). README and docs/design.md document the Windows install.

Decisions

  • Decided: zip archives on Windows, built with python3 -m zipfile (the installer tests already need python3; zip isn't guaranteed on the runner).
  • Decided: Windows restart uses os.StartProcess because the noctx linter rejects exec.Command without a context.

Test plan

  • go test ./... passes; new tests cover the zip Apply path (amd64 and arm64, missing binary, bad checksums) and the per-OS helpers for paths, shell, browser and editor.
  • make release produces six archives; scripts/test-install.sh passes, including a new case for the Windows zips.
  • golangci-lint clean on Linux and GOOS=windows; make vet-windows passes.
  • Not run on a real Windows machine: install.ps1, the Windows restart, rundll32 and notepad are verified by compile, vet and review only.

Follow-ups

  • Windows package managers (winget, scoop) and code signing are out of scope.

Refs #99

🤖 Generated with Claude Code

https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX

## Summary Windows build and install path for lazyforge: release zips for `windows/amd64` and `windows/arm64`, a PowerShell installer, working self-update, and the platform bits that assumed Linux or macOS. ## Changes - `make release` also builds `lazyforge_<tag>_windows_{amd64,arm64}.zip` (single entry `lazyforge.exe`); `checksums.txt` lists all six archives. - `install.ps1`: picks the arch, verifies the SHA-256, installs to `%LOCALAPPDATA%\Programs\lazyforge`, adds it to the user `PATH` (and broadcasts the change). Re-running upgrades in place, renaming a running exe aside if needed. - Self-update: `Apply` downloads and extracts the zip on Windows. The restart is now `restart()` in build-tagged files: `syscall.Exec` on Unix, a child process with stdio and exit code forwarded on Windows. - Config and state live under `%AppData%\lazyforge` on Windows (XDG overrides still win). - `openBrowser` uses `rundll32 url.dll,FileProtocolHandler`; the `$EDITOR` fallback is `notepad`; `token_cmd` runs through `cmd /C`. - `make check` gains `vet-windows` (vet and build both Windows targets). README and `docs/design.md` document the Windows install. ## Decisions - Decided: zip archives on Windows, built with `python3 -m zipfile` (the installer tests already need `python3`; `zip` isn't guaranteed on the runner). - Decided: Windows restart uses `os.StartProcess` because the `noctx` linter rejects `exec.Command` without a context. ## Test plan - `go test ./...` passes; new tests cover the zip `Apply` path (amd64 and arm64, missing binary, bad checksums) and the per-OS helpers for paths, shell, browser and editor. - `make release` produces six archives; `scripts/test-install.sh` passes, including a new case for the Windows zips. - `golangci-lint` clean on Linux and `GOOS=windows`; `make vet-windows` passes. - **Not run on a real Windows machine:** `install.ps1`, the Windows restart, `rundll32` and `notepad` are verified by compile, vet and review only. ## Follow-ups - Windows package managers (winget, scoop) and code signing are out of scope. Refs #99 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX
make release builds lazyforge.exe for windows/amd64 and windows/arm64 into zip archives, listed in checksums.txt. install.ps1 downloads the matching zip, verifies it by exact filename match, and installs to %LOCALAPPDATA%\Programs\lazyforge. test-install.sh covers the zips.

Refs #99

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX
Apply downloads lazyforge_<tag>_windows_<arch>.zip on windows, verifies it, and swaps lazyforge.exe in. Windows has no exec that replaces the process, so restart runs the new exe as a child and exits with its code; unix keeps syscall.Exec in its own build-tagged file.

Refs #99

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX
DefaultPaths puts config and state under %AppData% on windows, as darwin does, and the XDG variables still win. token_cmd runs through cmd /C on windows. Browsers open with rundll32 and $EDITOR falls back to notepad. Each choice is a pure helper keyed on goos so it can be tested from any platform.

Refs #99

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX
Refs #99

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX
Refs #99

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX
fix(install): broadcast the PATH change and quiet download progress in install.ps1
All checks were successful
ci / check (pull_request) Successful in 1m50s
3da9ca8c3d
Refs #99

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JM4weH5nADZqsaZ5MREXUX
deadstyle merged commit 086f186253 into develop 2026-10-09 12:02:09 -05:00
deadstyle deleted branch feature/99-windows-support 2026-10-09 12:02:09 -05:00
Sign in to join this conversation.
No description provided.