Today we are releasing a free hosted open source web update service and accompanying npm package to provide simple automatic updates for Electron open source applications. This is a step toward making application developers think less about deployment and more about creating a high-quality experience for their users.
The new update module in action
Electron has an autoUpdater API that gives apps the ability to use metadata from a remote endpoint to check for updates, download them in the background, and automatically install them.
Today we are announcing a new solution for automatic app updates. If your Electron app is in a public GitHub repository and you use GitHub Releases to publish builds, you can use this service to continuously deliver app updates to your users.
Using a new module
To minimize customization on your part, we’ve created update-electron-app, an npm module that integrates with the new update.electronjs.org web service.
Install the module:
- npm install update-electron-app;
Call it from anywhere in the main process of your application:
- require(‘update-electron-app’)();
That’s it! The module will check for updates when the application starts, and then every ten minutes thereafter. If an update is detected, it will be downloaded automatically in the background, when the update completes, a dialog box will appear.
Porting existing applications
Applications already using Electron’s autoUpdater API can also use this service. To do so, you can customize the update-electron-app module or integrate it directly from update.electronjs.org.
If your application is private, you may need to run your own update server. There are a number of open source tools for this, including Hazel by Zeit and Nucleus by Atlassian.