A simple Windows desktop application built with Electron, Node.js, HTML, and CSS. It checks for updates from a GitHub repository and auto-updates itself using GitHub Releases.
- 🧭 Auto-check for updates on launch
- 🚀 Auto-download and install updates from GitHub Releases
- 🔁 Silent update & restart
- 💻 Built for Windows (32/64-bit)
- Electron
- Node.js
- HTML & CSS
- electron-updater via electron-builder
- GitHub Releases for deployment
- Node.js (v18 or later)
- Git
- Windows OS (Tested on Windows 10/11)
- A GitHub repository with signed releases (for updates)
-
Clone the repo
git clone https://github.com/ColdByDefault/electron-auto-updater.git cd electron-auto-updater
-
Install dependencies
npm install
-
Run the app in development
npm start
-
Build the app for production
npm run dist
Ensure you configure the build
section in your package.json
:
"build": {
"appId": "com.yourdomain.yourapp",
"productName": "YourAppName",
"publish": [
{
"provider": "github",
"owner": "your-username",
"repo": "your-repo"
}
],
"win": {
"target": "nsis"
},
"nsis": {
"oneClick": false,
"perMachine": true,
"allowToChangeInstallationDirectory": true
}
}
🔐 Make sure your GitHub repo has signed releases and you generate
.yml
and.exe
assets during packaging.
- On launch, the app checks the GitHub Releases API for a new version.
- If a new version is found, it's downloaded automatically.
- When the download is complete, the app prompts or automatically installs the update and restarts.
- Update your app version in
package.json
. - Build the release:
npm run dist
- Create a new GitHub Release and upload the generated
.exe
and.yml
files from thedist
folder.
- Always sign your releases
- Never expose sensitive keys in your codebase
- Use
.env
files or GitHub Secrets for CI/CD