The profile shipped with the app listed only the certificate whose private key
was lost with the old Mac, so it would have signed the new build without
complaint and then dropped keychain-access-groups at runtime, taking passkeys
and Touch ID with it. Regenerated against the cert we can actually sign with;
the preflight added alongside it now refuses any build where the two disagree.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wtspwSFzZmjCx9UNPAorQ
- the customInstall macro runs `OpenSwarm.exe --prewarm` via nsExec::Exec,
which is synchronous with no upper time bound. On a clean box the silent
install launches the freshly-extracted, not-yet-signed binaries, provoking a
cold Windows Defender scan that stalls for minutes - this hung the CI
installer-verification step (no output for ~3m, then cancelled)
- both CI verification and production auto-updates run the installer with /S,
so this same stall could hang a real user's auto-update
- gate the prewarm behind ${If} ${Silent} ... ${Else}: interactive first-time
installs (where the cold-start win lands) still prewarm; silent installs skip
it and finish promptly
- verify-installer: keep the blocking spawnSync (it must wait for the registry
uninstall entry the gate checks) but add a 300s timeout so any future
synchronous stall fails the gate in minutes instead of hanging the job
- root cause: window-all-closed called killBackend() (windows: taskkill /F) BEFORE before-quit could POST /shutdown-all, so the backend died before running stop_all(), orphaning the bundled vite node.exe; a running node.exe locks its own image at resources\node\x64\node.exe, so the next nsis upgrade cannot overwrite it and surfaces appCannotBeClosed via the file-lock retry path (extractAppPackage.nsh / installUtil.nsh), not the name-based app-running check
- windows-only because mac's killBackend sends SIGTERM, letting uvicorn run its lifespan shutdown -> stop_all(); only since 1.1.64 because app builder first spawned these children on windows in bf6d7a9 (before that they died with WinError 2)
- electron/main.js: drop the premature killBackend() in window-all-closed (will-quit still kills the backend, now AFTER the reap) and raise the pre-quit reap budget from 2s to 10s to cover stop_all's parallel taskkill (up to 5s) + 3s grace
- electron/build/installer-recovery.nsh: replace the customInit orphan-killer (wmic, removed from windows 11 24H2 so it silently no-oped) with a path-scoped powershell Stop-Process; backtick-delimited for valid nsis tokenization, verified the macro compiles with makensis + the bundled nsExec plugin
- mac unaffected: will-quit already kills the backend; the app reap just runs explicitly via /shutdown-all now instead of riding on SIGTERM timing; the .nsh path is windows-only
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three changes that make Windows installs/upgrades stop stalling on the
'OpenSwarm cannot be closed' modal -- independent of the cloud OAuth
work happening on the Mac side.