Skip to content
πŸ“‘ A free service that makes it easy for open-source Electron apps to update themselves.
Branch: master
Clone or download
Latest commit 5ead9bd Nov 27, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin define default redis url differently so REDIS_URL is not required Apr 25, 2018
example Make example using electron-forge for consistency πŸŽ‰ Apr 29, 2018
test add tests Sep 24, 2018
.env.example define default redis url differently so REDIS_URL is not required Apr 25, 2018
.gitignore document environment variables Apr 25, 2018
.travis.yml
Procfile add procfile Apr 4, 2018
README.md add arch to url, defaulting to x64 (no breaking change) Sep 24, 2018
index.js
package-lock.json update nodemon Nov 28, 2018
package.json

README.md

πŸ“‘ update.electronjs.org

A free service that makes it easy for open-source Electron apps to update themselves.

Build Status

Requirements

Before using this service, make sure your Electron app meets these criteria:

  • Your app runs on macOS or Windows
  • Your app has a public GitHub repository
  • Your builds are published to GitHub Releases
  • Your builds are code signed

Quick Setup

Install update-electron-app as a runtime dependency (not a devDependency):

npm install update-electron-app --save

Call it from in you main process file:

require('update-electron-app')()

And that's all it takes! To customize, see the update-electron-app API.

Once your application is packaged, it will update itself for each new GitHub Release that you publish.

Manual Setup

Use something like the following setup to add automatic updates to your application:

Important: Please ensure that the code below will only be executed in your packaged app, and not in development. You can use electron-is-dev to check for the environment.

const { app, autoUpdater } = require('electron')

Next, construct the URL of the update server and tell autoUpdater about it:

const server = 'https://update.electronjs.org'
const feed = `${server}/OWNER/REPO/${process.platform}-${process.arch}/${app.getVersion()}`

autoUpdater.setFeedURL(feed)

As the final step, check for updates. The example below will check every 10 minutes:

setInterval(() => {
  autoUpdater.checkForUpdates()
}, 10 * 60 * 1000)

Once your application is packaged, it will update itself for each new GitHub Release that you publish.

Routes

/:owner/:repo/:platform/:version

/:owner/:repo/win32/:version/RELEASES

Development

$ npm install
$ redis-server
$ GH_TOKEN=TOKEN npm start

To try with an actual electron app, run:

$ npm start &
$ cd example
$ npm install

On Darwin:

$ npm run build
$ ./out/test-darwin-x64/test.app/Contents/MacOS/test

On Windows:

$ npm run build
$ "example\out\make\squirrel.windows\x64\test-0.0.0 Setup.exe"
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.