windows-local-buildlisted
Install: claude install-skill yybd/app-factory
# Build and test a Windows app locally, from a Mac
Building Windows in GitHub Actions is the easy default and the expensive one: on a
private repo a Windows minute counts twice, and an allowance that runs out stops
every build in every repo until the month turns. A Tauri app does not need it. The
installer **cross-compiles on the Mac**, and a Windows VM on the same Mac **installs
and checks** it — both driven from one script.
Four things carry the weight, and each has its reasons in
[references/local-build.md](references/local-build.md):
1. **makensis needs a UTF-8 locale.** Without one it dies with `std::bad_alloc`,
which reads like a memory problem and is not. The script sets `LC_ALL` itself.
2. **The VM sees only some of the Mac.** Never assume a project folder is shared;
check, and stage files through a folder that is.
3. **The check runs without a window** (`--selftest`), because the VM is often
someone's working Windows, and a test that opens windows over it is a test
nobody runs.
4. **Xcode 27's linker corrupts release links** when `MACOSX_DEPLOYMENT_TARGET` is 12
or higher. The cross build fails on it, and a **Mac** release build is damaged by it
silently. The script links host code through a wrapper that avoids it.
## Prerequisites
- **Tools:** a Tauri 2 app with an NSIS target; on the Mac `brew install nsis llvm`,
`cargo install --locked cargo-xwin`,
`rustup target add x86_64-pc-windows-msvc aarch64-pc-windows-msvc`, Node (`npx`),
`pytho