scripts/windows/: setup-build-env.ps1 persists the NVENC build env (Machine scope: PUNKTFUNK_NVENC_LIB_DIR, LIBCLANG_PATH, CMAKE_POLICY_VERSION_MINIMUM -- no FFMPEG_DIR, the nvenc build doesn't link libavcodec). deploy-host.ps1 rebuilds --release --features nvenc and restarts the PunktfunkHost service with .bak rollback on build/start failure. build-web.ps1 rebuilds the Nitro web console (bun build, node runtime) and restarts the PunktfunkWeb task. README documents the flow -- a redeploy is now a single script call. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Windows host build/deploy scripts
Helper scripts for the Windows host box (the RTX .173 lab box, repo at
C:\Users\Public\punktfunk-native). Run them from the repo root in an elevated PowerShell.
One-time: persist the build environment
powershell -ExecutionPolicy Bypass -File scripts\windows\setup-build-env.ps1
Persists (Machine scope) the three vars the NVENC build needs:
| var | value | why |
|---|---|---|
PUNKTFUNK_NVENC_LIB_DIR |
C:\Users\Public\nvenc |
NVENC import lib (nvencodeapi.lib) |
LIBCLANG_PATH |
C:\Program Files\LLVM\bin |
bindgen (libclang.dll) |
CMAKE_POLICY_VERSION_MINIMUM |
3.5 |
audiopus_sys / cmake crates |
FFMPEG_DIR is not set — the --features nvenc build the RTX box uses does not link
libavcodec (that is only the amf-qsv feature). The VS C++ toolchain is loaded per-build via
vcvars64.bat (auto-discovered with vswhere).
Rebuild + redeploy the host service
powershell -ExecutionPolicy Bypass -File scripts\windows\deploy-host.ps1
Stops PunktfunkHost, backs up the current binary (punktfunk-host.exe.bak), builds
--release -p punktfunk-host --features nvenc from the current source, then restarts the
service on the new binary — with automatic rollback if the build fails or the new binary
won't start. The service is down only for the build duration.
Rebuild + restart the web console
powershell -ExecutionPolicy Bypass -File scripts\windows\build-web.ps1
bun install && bun run build, installs the externalized server deps into .output/server
(with the @unom .npmrc), then restarts the PunktfunkWeb task and checks :3000/login.
Typical flow after pulling new code
git pull
powershell -ExecutionPolicy Bypass -File scripts\windows\deploy-host.ps1
powershell -ExecutionPolicy Bypass -File scripts\windows\build-web.ps1