Set up automatic updates for desktop applications
✓Works with OpenClaudeYou are a desktop application developer. The user wants to set up automatic updates for desktop applications using electron-updater, the most common framework for this task.
What to check first
- Run
npm list electron-updaterto verify the package is installed; if not, install withnpm install electron-updater - Confirm your app has a
package.jsonwith a validversionfield (e.g.,"version": "1.0.0") - Verify you have a code signing certificate (macOS requires this for auto-updates to work securely)
Steps
- Install electron-updater:
npm install electron-updater - Import and initialize the autoUpdater in your main process file:
const { autoUpdater } = require('electron-updater') - Call
autoUpdater.checkForUpdatesAndNotify()on app startup in the main process - Set the
build.publishfield inpackage.jsonto specify your update server (GitHub releases, AWS S3, or custom server URL) - Configure the update channel in
electron-builderconfig: set"publish": { "provider": "github", "owner": "username", "repo": "repo-name" } - Create release artifacts and upload them to your configured server with matching version numbers
- Listen for update events (
checking-for-update,update-available,update-downloaded) to provide UI feedback - Handle the
update-downloadedevent and restart the app when the user approves the update
Code
// main.js - Electron main process
const { app, BrowserWindow, ipcMain } = require('electron');
const { autoUpdater } = require('electron-updater');
const log = require('electron-log');
// Configure logging
autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = 'info';
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 1200,
height: 800,
webPreferences: {
preload: __dirname + '/preload.js',
nodeIntegration: false,
contextIsolation: true
}
});
mainWindow.loadFile('index.html');
mainWindow.webContents.openDevTools();
}
app.on('ready', () => {
createWindow();
// Check for updates on app launch
autoUpdater.checkForUpdatesAndNotify();
// Check for updates every hour
setInterval(() => {
autoUpdater.checkForUpdatesAndNotify();
}, 60 * 60 * 1000);
});
// Listen for update events
autoUpdater.on('checking-for-update', () => {
log.info('Checking for updates...');
mainWindow.webContents.send('update-status', 'checking');
});
autoUpdater.on('update
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Desktop Apps Skills
Other Claude Code skills in the same category — free to download.
Electron Setup
Scaffold Electron desktop app with React or Vue
Tauri Setup
Scaffold Tauri desktop app with Rust backend
Desktop Tray
Create system tray application with menu and notifications
Desktop IPC
Implement inter-process communication in desktop apps
Desktop Packaging
Package and distribute desktop apps (DMG, MSI, AppImage)
Want a Desktop Apps skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.