-
Notifications
You must be signed in to change notification settings - Fork 0
Update Manager
Sandeep Vattapparambil edited this page Aug 19, 2026
·
1 revision
Custom in-app update manager that checks GitHub Releases for new versions, downloads the platform-specific installer, and launches it on completion.
About page β updateStore.checkForUpdates β electronAPI.checkForUpdates
β updater.ts fetches GitHub Releases API β compares semver versions
β send(update-available / update-not-available) β updateStore β UpdateDialog
β electronAPI.downloadUpdate β updater.ts downloads installer to temp dir
β send(update-progress) β updateStore β progress bar
β send(update-downloaded) β updateStore β "Install & Restart" button
β electronAPI.installUpdate β shell.openPath(installer) + app.quit()
| File | Role |
|---|---|
src/main/updater.ts |
Core logic: version comparison, release fetching, asset selection, download, install |
src/main/ipc/updater.ts |
IPC handler registration |
src/renderer/stores/updateStore.ts |
Zustand store for update lifecycle state |
src/renderer/components/UpdateDialog.tsx |
UI dialog for check/download/install flow |
src/renderer/pages/About.tsx |
"Check for Updates" button |
src/shared/types.ts |
UpdateInfo, UpdateAsset, UpdateProgress types |
src/shared/ipc-channels.ts |
10 update channel constants |
| Channel | Direction | Purpose |
|---|---|---|
check-for-updates |
renderer -> main | Trigger update check |
download-update |
renderer -> main | Start downloading installer |
install-update |
renderer -> main | Launch installer + quit app |
cancel-download |
renderer -> main | Cancel in-progress download |
open-release-notes |
renderer -> main | Open release notes URL in browser |
update-available |
main -> renderer | New version available |
update-not-available |
main -> renderer | Already up to date |
update-progress |
main -> renderer | Download progress (bytes, percent) |
update-downloaded |
main -> renderer | Download complete, ready to install |
update-error |
main -> renderer | Error during check or download |
Uses semver with pre-release suffix stripping. The updater fetches https://api.github.com/repos/Sandeepv68/EncodeX/releases/latest, parses the tag as semver, and compares against app.getVersion().
Automatically selects the platform-appropriate installer:
| Platform | Asset pattern |
|---|---|
| Windows |
*.exe (NSIS installer) |
| macOS | *.dmg |
| Linux | *.AppImage |
The UpdateDialog component handles these states:
- Idle β "Check for Updates" button
- Checking β Loading spinner
- Available β Version info + "Download" button + release notes link
- Downloading β Progress bar with percentage
- Downloaded β "Install & Restart" button
- Error β Error message + retry button
- Not Available β "You're up to date" message
- Unit tests:
src/main/ipc/__tests__/handlers.test.ts(updater mock) - E2E: Update dialog state transitions covered via mock preload (
e2e/mocks/preload.js) - All updater API methods mocked in
src/test-setup.tsfor renderer tests
Getting Started
Internals
Quality
Community