GithubHelp home page GithubHelp logo

bhanditz / update-electron-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from electron/update-electron-app

0.0 2.0 0.0 152 KB

๐ŸŒฒ A drop-in module that adds autoUpdating capabilities to Electron apps

License: MIT License

JavaScript 100.00%

update-electron-app's Introduction

update-electron-app

A drop-in module that adds autoUpdating capabilities to Electron apps

Powered by the free and open-source update.electronjs.org service.

screenshot

Requirements

Before using this module, 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

Installation

npm i update-electron-app

Usage

Drop this anywhere in your main process:

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

That's it! Here's what happens by default:

  • Repository URL is found in your app's package.json file.
  • Your app will check for updates at startup, then every ten minutes. This interval is configurable.
  • No need to wait for your app's ready event; the module figures that out.
  • If an update is found, it will automatically be downloaded in the background.
  • When an update is finished downloading, a dialog is displayed allowing the user to restart the app now or later.

You can also specify custom options:

require('update-electron-app')({
  repo: 'github-user/repo',
  updateInterval: '1 hour',
  logger: require('electron-log')
})

API

update(options)

Options:

  • repo String (optional) - A GitHub repository in the format owner/repo. Defaults to your package.json's "repository" field
  • host String (optional) - Defaults to https://update.electronjs.org
  • updateInterval String (optional) - How frequently to check for updates. Defaults to 10 minutes. Minimum allowed interval is 5 minutes.
  • logger Object (optional) - A custom logger object that defines a log function. Defaults to console. See electron-log, a module that aggregates logs from main and renderer processes into a single file.

FAQ

What kinds of assets do I need to build?

For macOS, you'll need to build a .zip file and include it in your GitHub Release. Use electron-forge or electron-installer-zip to package your app as a zip.

For Windows, you'll need to build a .exe file and include it in your GitHub Release.

Why is my app launching multiple times?

Windows apps have an update process that requires multiple application restarts. You can use the electron-squirrel-startup module to improve this behavior.

Can I use this module by uploading my private app's builds to a public GitHub repository?

Yes :)

License

MIT

See Also

If your app is packaged with electron-builder, you may not need this module. Builder has its own built-in mechanism for updating apps. Find out more at electron.build/auto-update.

update-electron-app's People

Contributors

amilajack avatar codebytere avatar juliangruber avatar vhashimotoo avatar zeke avatar

Watchers

 avatar  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.