Git Product home page Git Product logo

update.electronjs.org's Introduction

๐Ÿ“ก 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"

update.electronjs.org's People

Contributors

dependabot[bot] avatar juliangruber avatar marshallofsound avatar vhashimotoo avatar zeke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.