Skip to content

fix(desktop): handle Squirrel startup events + CI smoke-install the Windows build#398

Merged
harshitsinghbhandari merged 2 commits into
mainfrom
fix/windows-squirrel-install
Jun 23, 2026
Merged

fix(desktop): handle Squirrel startup events + CI smoke-install the Windows build#398
harshitsinghbhandari merged 2 commits into
mainfrom
fix/windows-squirrel-install

Conversation

@harshitsinghbhandari

Copy link
Copy Markdown
Collaborator

Context

The Windows Squirrel installer fails on a tester's machine with "Installation has failed" and no SquirrelSetup.log entry at all, meaning Setup.exe dies before Update.exe (the part that logs) runs. The built artifacts are healthy (119MB Setup.exe wrapping a 118MB nupkg + RELEASES), so the build isn't truncated; the failure is host-side and/or in the install hooks. This PR addresses the app-side gap and gives us a way to actually capture the log.

Changes

1. Handle Squirrel startup events (main.ts). The app had no electron-squirrel-startup handler, only update-electron-app (auto-updates, unrelated). During install Squirrel runs the exe with --squirrel-install/--squirrel-updated/--squirrel-uninstall/--squirrel-obsolete and waits for it to exit; without the handler the full app booted (window + daemon) and never exited, hanging the installer. Now it creates/removes shortcuts and quits immediately. No-op on macOS/Linux. (electron-squirrel-startup ships no types, so a 6-line ambient .d.ts is added rather than pulling in @types.)

2. CI smoke-install (testing-build.yml). After the Windows build, run Setup.exe --silent on the clean native x64 windows-latest runner, assert %LocalAppData%\AgentOrchestrator is created, and upload SquirrelSetup.log as a workflow artifact (continue-on-error, so it never blocks publishing).

This is a build-vs-host verdict:

  • Installs cleanly on the runner → the artifact is good → a failing user machine is host-side (AV / disk space / signing).
  • Fails on the runner → the build/Squirrel config is wrong, and we now have the log to see why.

Caveat documented in the workflow: the runner has no real-time AV, so a clean install there does not prove SmartScreen/Defender will accept the unsigned binaries on end-user machines. Authenticode code-signing remains the durable fix and is the next follow-up.

Testing

  • npm run typecheck ✅ (confirms the import + ambient declaration resolve)
  • The smoke-install step is itself the integration test; first CI run on this branch will exercise it and attach the log.

🤖 Generated with Claude Code

harshitsinghbhandari and others added 2 commits June 23, 2026 16:33
…indows build

Two Windows-install fixes.

1. Add electron-squirrel-startup handling. main.ts had no handler for the
   --squirrel-{install,updated,uninstall,obsolete} flags Squirrel runs the exe
   with during install/update/uninstall. Without it the install hook booted the
   full app (window + daemon spawn) and never exited, so the installer hung
   waiting on it. Now we create/remove shortcuts and quit immediately; it is a
   no-op on macOS/Linux.

2. Add a Windows CI smoke-install step. After the build, run Setup.exe --silent
   on the clean native x64 windows-latest runner, assert the install dir is
   created, and upload SquirrelSetup.log as an artifact. This captures the
   install log we otherwise cannot get and gives a build-vs-host verdict: a clean
   install proves the artifact is good, so a failing user machine is host-side
   (AV/disk/signing). The runner has no real-time AV, so it does NOT prove
   SmartScreen/Defender will accept the unsigned binaries on end-user machines;
   code-signing stays the durable fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ng warning

Update.exe writes SquirrelSetup.log into %LocalAppData%\AgentOrchestrator, not
SquirrelTemp; the smoke step looked only in SquirrelTemp and so printed
"failed before Update.exe ran" even on a successful install (exit 0, dir
created). Look in the app root dir first, fall back to SquirrelTemp, and drop
the false-failure wording.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@harshitsinghbhandari harshitsinghbhandari merged commit 7ac1e2c into main Jun 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant