A simple update server for electron applications running on macOS.
- Install dependencies:
npm install-
Place your app update files in the
updatesdirectory:latest-mac.yml- Contains the latest version informationMyApp-x.x.x-mac.zip- Your packaged application
-
Update the
latest-mac.ymlfile with:- Current version number
- Correct SHA512 hash of your app
- Correct file size
- Current release date
Development mode:
npm run devProduction mode:
npm startIn your electron app's main process, configure the auto updater:
const { autoUpdater } = require('electron-updater');
autoUpdater.setFeedURL({
provider: 'generic',
url: 'http://your-server:9191/update/darwin'
});
// Check for updates
autoUpdater.checkForUpdates();The server will serve update files from the updates directory and provide version information through the /update/darwin endpoint.