• Stars
    star
    606
  • Rank 73,958 (Top 2 %)
  • Language
    JavaScript
  • License
    The Unlicense
  • Created almost 8 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A complete example showing how to use `electron-updater`

This repo contains the bare minimum code to have an auto-updating Electron app using electron-updater with releases stored on GitHub.

If you can't use GitHub, you can use other providers:

NOTE: If you want to run through this whole process, either fork this repo or start your own from a template. Then replace all instances of iffy with your GitHub username before doing the following steps.

  1. For macOS, you will need a code-signing certificate.

    Install Xcode (from the App Store), then follow these instructions to make sure you have a "Developer ID Application" certificate. If you'd like to export the certificate (for automated building, for instance) you can. You would then follow these instructions.

    This example application is set up to perform code-signing and notarization on Mac OS provided that a Developer ID Application certificate is installed in the default keychain. The following environment variables are important for the signing process:

    • CSC_IDENTITY_AUTO_DISCOVERY - controls whether electron-builder tries to sign the application; default is true, set to false to skip signing
    • APPLE_ID - the Apple ID to use for notarization (required for signing).
    • APPLE_ID_PASSWORD - the password to use with the specified Apple ID for notarization (required for signing). Apple recommends setting up an app-specific password to safeguard the Apple ID password (see Apple Support) for more information.

    To enable code-signing and notarization:

     export CSC_IDENTITY_AUTO_DISCOVERY="true"
     export APPLE_ID="<your Apple ID>"
     export APPLE_ID_PASSWORD="<your Apple Password>"
    
  2. Adjust package.json if needed.

    By default, electron-updater will try to detect the GitHub settings (such as the repo name and owner) from reading the .git/config or from reading other attributes within package.json. If the auto-detected settings are not what you want, configure the publish property as follows:

     {
         ...
         "build": {
             "publish": [{
                 "provider": "github",
                 "owner": "iffy",
                 "repo": "electron-updater-example"
             }],
             ...
         }
     }
    
  3. Install necessary dependencies with:

     yarn
    

    or

     npm install
    
  4. Generate a GitHub access token by going to https://github.com/settings/tokens/new. The access token should have the repo scope/permission. Once you have the token, assign it to an environment variable

    On macOS/linux:

     export GH_TOKEN="<YOUR_TOKEN_HERE>"
    

    On Windows, run in powershell:

     [Environment]::SetEnvironmentVariable("GH_TOKEN","<YOUR_TOKEN_HERE>","User")
    

    Make sure to restart your IDE/Terminal to inherit latest env variable.

  5. Publish for your platform with:

     electron-builder -p always
    

    or

     npm run publish
    

    If you want to publish for more platforms, edit the publish script in package.json. For instance, to build for Windows and macOS:

     ...
     "scripts": {
         "publish": "electron-builder --mac --win -p always"
     },
     ...
    

    NOTE: The Mac OS signing/notarization process must be run on Mac OS.

  6. Release the release on GitHub by going to https://github.com/YOUR_GIT_HUB_USERNAME/electron-updater-example/releases, editing the release and clicking "Publish release."

  7. Download and install the app from https://github.com/YOUR_GIT_HUB_USERNAME/electron-updater-example/releases.

  8. Update the version in package.json, commit and push to GitHub.

  9. Do steps 5 and 6 again.

  10. Open the installed version of the app and see that it updates itself.

More Repositories

1

nim-argparse

Argument parsing for Nim
Nim
121
star
2

wiish

Why Is It So Hard (to make a cross-platform app)?
Nim
114
star
3

lhtml

An app for working with local HTML files.
JavaScript
85
star
4

install-nim

Github Action to install Nim
Shell
30
star
5

changer

A small command-line utility for updating changelogs easily.
Nim
26
star
6

grace

Graceful server restart
Python
24
star
7

nimxc

Nim cross-compiler tool
C
19
star
8

nim-keyring

Cross-platform access to OS keyring
Nim
16
star
9

nim-embedfs

Nim library to embed directories in your executable
Nim
16
star
10

nim-intl

Nim library for i18n and l10n
Nim
9
star
11

electron-autoupdate-example

A complete example showing how to use electron's autoUpdater
JavaScript
7
star
12

norm

Asynchronous, cross-database library
Python
6
star
13

scriptfs

Python
5
star
14

lin

Linear build system (in Nim)
Nim
5
star
15

termtools

Nim terminal tools
Nim
5
star
16

nim-stripe

Nim library for using the Stripe API
Nim
4
star
17

parsefin

Tools for parsing OFX/QFX/OFC/csv financial files.
Python
4
star
18

nim-protocols

A protocol library for Nim
Nim
3
star
19

generalconference

Programming-friendly General Conference
Python
3
star
20

nim-totp

TOTP command line tool
Nim
3
star
21

humancrypto

Cryptography for humans
Python
2
star
22

campus

A terminal MUDish server
Python
2
star
23

txcas

CAS server implemented with Twisted
Python
2
star
24

simplebb

A dumb-server, smart-client automated build system
Python
2
star
25

inliner

Make standalone HTML pages
Python
2
star
26

iffy.github.com

HTML
1
star
27

gdax-ts

TypeScript promise-returning interface to GDAX
TypeScript
1
star
28

blog

Script to render code snippets and publish to Blogger
Python
1
star
29

eventsts

Simple typed event emitter
TypeScript
1
star
30

boom

Bomberman clone used as tutorial for learning Twisted
Python
1
star
31

sqldiff

Makes SQL needed to turn one schema dump into another.
Python
1
star
32

nim-ohm

A Nim implementation of the Ohm grammar/parser
Nim
1
star
33

unidb

Unified DB API based on Twisted and web.py
Python
1
star
34

twistedftw

Twisted tutorials for beginners
Python
1
star
35

nim-sentry

Nim client for Sentry.io
Nim
1
star
36

moldspec

Mold specification
Python
1
star
37

gocatgo

cat, written in go
Go
1
star
38

chalkboard

A simple online chalkboard
Python
1
star
39

nim-memtools

Nim
1
star