electron-squirrel-startup
Default Squirrel.Windows install/update event handler for Electron apps
Repository Health
Technical Analysis
electron-squirrel-startup is a tiny utility that handles the Squirrel.Windows installer lifecycle events (--squirrel-install, --squirrel-updated, --squirrel-uninstall, --squirrel-obsolete) that fire when an Electron app built for Windows is installed, updated, or removed. Requiring it at the top of an Electron app’s main process handles desktop shortcut creation/removal automatically and quits the app during these transient install-time launches, which would otherwise show a confusing flash of the app window during install.
Maintained by MongoDB (originally for Compass, MongoDB’s GUI), it has become one of the standard boilerplate dependencies scaffolded by Electron Forge and other Electron app generators for any project targeting Windows via Squirrel.
What You Get
- Automatic desktop shortcut creation on
--squirrel-install/--squirrel-updated - Automatic desktop shortcut removal on
--squirrel-uninstall - Clean early exit on
--squirrel-obsoleteto avoid showing a stray window - A single boolean return value telling the caller whether to quit immediately
- Debug logging via the
debugpackage for troubleshooting installer events
Common Use Cases
- Preventing an Electron app’s main window from flashing open during Windows install/update
- Ensuring a desktop shortcut is created automatically when a Squirrel.Windows installer runs
- Cleaning up shortcuts when a user uninstalls a Squirrel-packaged Electron app
- Standard boilerplate included by Electron Forge’s Squirrel.Windows maker template
Under The Hood
Architecture — The entire implementation is a single index.js file: a check() function inspects process.platform and process.argv[1] for the four Squirrel command flags, and a run() helper spawns the Squirrel-provided Update.exe (located relative to the running executable) with the appropriate --createShortcut/--removeShortcut argument, quitting the Electron app once the spawned process closes.
Tech Stack — Plain CommonJS JavaScript with a single runtime dependency (debug) and Electron itself as an implicit peer (via require('electron').app); tested with electron-mocha and CI’d historically via Travis and AppVeyor for cross-platform coverage.
Code Quality — Given its narrow, install-time-only responsibility, the codebase is intentionally minimal (well under 50 lines) with a small dedicated test/ directory; there is no ongoing feature development expected since the Squirrel.Windows event contract it implements is stable and unchanging.
API Design — The API is a single require() call whose return value doubles as a boolean signal (if (require('electron-squirrel-startup')) app.quit();), which is about as low-friction as an integration can get — it requires no configuration and is typically the very first line of an Electron app’s main process.
Used by 10 apps in this directory
AFFiNE
Collaboration · Note Taking · Productivity
Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.
AionUi
AI Agents · Productivity
Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.
Amical
AI Assistants · Note Taking · Voice AI
Local-first AI dictation that understands your active app — private, offline, and built for speed.
Colanode
Collaboration · Knowledge Management · Team Chat
Local-first, self-hosted workspace that combines real-time chat, Notion-style pages, and structured databases — all synced via CRDTs so you work offline without losing a keystroke.
Dyad
AI Assistants · AI Code Assistants · AI Development
Build AI-powered apps locally with your own keys, your own models, and zero cloud lock-in.
GB Studio
Design Tools · Developer Tools · Game Development
Drag-and-drop retro Game Boy game creator that compiles real ROMs — no coding required.
Glass by Pickle
AI Assistants
A privacy-first desktop AI assistant that sees your screen, hears your meetings, and turns live context into structured summaries—without sending a single byte to the cloud.
Huly Platform
Collaboration · Project Management · Team Chat
Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.
rowboat
AI Assistants · AI Development
Build, test, and deploy multi-agent AI workflows with a visual editor, RAG data sources, MCP tool integration, and a production-ready REST API.