Electron App Update Notifier
Notify user about new app updates by fetching release from Github repository.
Motivation
update-electron-app is an auto updating solution for open source Electron apps. It is awesome but has some limitations:
- It does not support Linux currently
- Applications on macOS must be signed in order to work.
This package comes to help in these cases. Instead of downloading installer automatically, it simply notifies user to go to GitHub release page when updates available.
Installation
npm install electron-update-notifier
Usage
Auto check for updates on app start
const {app} = require('electron');
const {setUpdateNotification} = require('electron-update-notifier');
app.whenReady().then(() => {
setUpdateNotification({
repository: 'user/repo', // Optional, use repository field from your package.json when not specified
token: '', // Optional, GitHub api access token
debug: false, // Optional, default `false`, allows to check for updates during development as well
silent: true // Optional, notify when new version available, otherwise remain silent
})
})
Check for updates manually
const {checkForUpdates} = require('electron-update-notifier');
checkForUpdates({
// options
silent: false, // Warn about network failures and notify when there is no updates
})
Use it with update-electron-app:
switch (process.platform) {
case 'darwin':
case 'win32':
require('update-electron-app')()
break
default:
require('electron-update-notifier').setUpdateNotification({
// options
})
}
Acknowledgements
@pd4d10 for original work
License
MIT License