See publish configuration for information on how to configure your local or CI environment for automated deployments.
!!! info "Code signing is required on macOS" macOS application must be signed in order for auto updating to work.
- macOS: DMG.
- Linux: AppImage, DEB and RPM.
- Windows: NSIS.
All these targets are default, custom configuration is not required. (Though it is possible to pass in additional configuration, e.g. request headers.)
!!! info "Squirrel.Windows is not supported" Simplified auto-update is supported on Windows if you use the default NSIS target, but is not supported for Squirrel.Windows. You can easily migrate to NSIS.
- Dedicated release server is not required.
- Code signature validation not only on macOS, but also on Windows.
- All required metadata files and artifacts are produced and published automatically.
- Download progress and staged rollouts supported on all platforms.
- Different providers supported out of the box (GitHub Releases, Amazon S3, DigitalOcean Spaces, Keygen and generic HTTP(s) server).
- You need only 2 lines of code to make it work.
-
Install electron-updater as an app dependency.
-
Use
autoUpdater
fromelectron-updater
instead ofelectron
:JavaScript
const { autoUpdater } = require("electron-updater")
ES2015
import { autoUpdater } from "electron-updater"
-
Call
autoUpdater.checkForUpdatesAndNotify()
. Or, if you need custom behaviour, implementelectron-updater
events, check examples below.
!!! note
1. Do not call setFeedURL. electron-builder automatically creates app-update.yml
file for you on build in the resources
(this file is internal, you don't need to be aware of it).
2. zip
target for macOS is required for Squirrel.Mac, otherwise latest-mac.yml
cannot be created, which causes autoUpdater
error. Default target for macOS is dmg
+zip
, so there is no need to explicitly specify target.
!!! example "Example in TypeScript using system notifications" ```typescript import { autoUpdater } from "electron-updater"
export default class AppUpdater {
constructor() {
const log = require("electron-log")
log.transports.file.level = "debug"
autoUpdater.logger = log
autoUpdater.checkForUpdatesAndNotify()
}
}
```
- A complete example showing how to use.
- An encapsulated manual update via menu.
If you want to more control over the updater configuration (e.g. request header for authorization purposes), you can instantiate the updater directly.
import { NsisUpdater } from "electron-updater"
// Or MacUpdater, AppImageUpdater
export default class AppUpdater {
constructor() {
const options = {
requestHeaders: {
// Any request headers to include here
},
provider: 'generic',
url: 'https://example.com/auto-updates'
}
const autoUpdater = new NsisUpdater(options)
autoUpdater.addAuthHeader(`Bearer ${token}`)
autoUpdater.checkForUpdatesAndNotify()
}
}
You don't need to listen all events to understand what's wrong. Just set logger
.
electron-log is recommended (it is an additional dependency that you can install if needed).
autoUpdater.logger = require("electron-log")
autoUpdater.logger.transports.file.level = "info"
Note that in order to develop/test UI/UX of updating without packaging the application you need to have a file named dev-app-update.yml
in the root of your project, which matches your publish
setting from electron-builder config (but in yaml format). But it is not recommended, better to test auto-update for installed application (especially on Windows). Minio is recommended as a local server for testing updates.
Generated metadata files format changes from time to time, but compatibility preserved up to version 1. If you start a new project, recommended to set electronUpdaterCompatibility
to current latest format version (>= 2.16
).
Option electronUpdaterCompatibility
set the electron-updater compatibility semver range. Can be specified per platform.
e.g. >= 2.16
, >=1.0.0
. Defaults to >=2.15
1.0.0
latest-mac.json2.15.0
path2.16.0
files
Staged rollouts allow you to distribute the latest version of your app to a subset of users that you can increase over time, similar to rollouts on platforms like Google Play.
Staged rollouts are controlled by manually editing your latest.yml
/ latest-mac.yml
(channel update info file).
version: 1.1.0
path: TestApp Setup 1.1.0.exe
sha512: Dj51I0q8aPQ3ioaz9LMqGYujAYRbDNblAQbodDRXAMxmY6hsHqEl3F6SvhfJj5oPhcqdX1ldsgEvfMNXGUXBIw==
stagingPercentage: 10
Update will be shipped to 10% of userbase.
If you want to pull a staged release because it hasn't gone well, you must increment the version number higher than your broken release. Because some of your users will be on the broken 1.0.1, releasing a new 1.0.1 would result in them staying on a broken version.
latest.yml
(or latest-mac.yml
for macOS, or latest-linux.yml
for Linux) will be generated and uploaded for all providers except bintray
(because not required, bintray
doesn't use latest.yml
).
You can use a private repository for updates with electron-updater by setting the GH_TOKEN
environment variable (on user machine) and private
option.
If GH_TOKEN
is set, electron-updater will use the GitHub API for updates allowing private repositories to work.
!!! warning Private GitHub provider only for very special cases — not intended and not suitable for all users.
!!! note The GitHub API currently has a rate limit of 5000 requests per user per hour. An update check uses up to 3 requests per check.
The autoUpdater
object emits the following events:
error
Error
Emitted when there is an error while updating.
Emitted when checking if an update has started.
info
UpdateInfo (for generic and github providers) | VersionInfo (for Bintray provider)
Emitted when there is an available update. The update is downloaded automatically if autoDownload
is true
.
Emitted when there is no available update.
info
UpdateInfo (for generic and github providers) | VersionInfo (for Bintray provider)
progress
ProgressInfobytesPerSecond
percent
total
transferred
Emitted on progress.
info
UpdateInfo — for generic and github providers. VersionInfo for Bintray provider.
- builder-util-runtime
.BaseS3Options
⇐PublishConfiguration
.BintrayOptions
⇐PublishConfiguration
.BlockMap
.BlockMapDataHolder
.CustomPublishOptions
⇐PublishConfiguration
.DownloadOptions
.GenericServerOptions
⇐PublishConfiguration
.GithubOptions
⇐PublishConfiguration
.KeygenOptions
⇐PublishConfiguration
.PackageFileInfo
⇐BlockMapDataHolder
.ProgressInfo
.PublishConfiguration
.ReleaseNoteInfo
.RequestHeaders
⇐[key: string]: string
.S3Options
⇐BaseS3Options
.SnapStoreOptions
⇐PublishConfiguration
.SpacesOptions
⇐BaseS3Options
.UpdateFileInfo
⇐BlockMapDataHolder
.UpdateInfo
.WindowsUpdateInfo
⇐UpdateInfo
- .CancellationError ⇐
Error
- .CancellationToken ⇐
module:events.EventEmitter
.cancel()
.createPromise(callback)
⇒Promise<module:builder-util-runtime/out/CancellationToken.R>
.dispose()
- .DigestTransform ⇐
internal:Transform
- .HttpError ⇐
Error
.isServerError()
⇒Boolean
- .HttpExecutor
.addErrorAndTimeoutHandlers(request, reject)
.createRequest(options, callback)
⇒module:builder-util-runtime/out/httpExecutor.T
.doApiRequest(options, cancellationToken, requestProcessor, redirectCount)
⇒Promise<String>
.downloadToBuffer(url, options)
⇒Promise<module:global.Buffer>
.prepareRedirectUrlOptions(redirectUrl, options)
⇒module:http.RequestOptions
.request(options, cancellationToken, data)
⇒Promise< | String>
.retryOnServerError(task, maxRetries)
⇒Promise<any>
- .ProgressCallbackTransform ⇐
internal:Transform
- .UUID
.check(uuid, offset)
⇒"undefined"
|module:builder-util-runtime/out/uuid.__object
|module:builder-util-runtime/out/uuid.__object
.inspect()
⇒String
.parse(input)
⇒module:global.Buffer
.toString()
⇒String
.v5(name, namespace)
⇒any
- .XElement
.asArray(v)
⇒Array<module:builder-util-runtime.T>
.configureRequestOptions(options, token, method)
⇒module:http.RequestOptions
.configureRequestOptionsFromUrl(url, options)
⇒module:http.RequestOptions
.configureRequestUrl(url, options)
.createHttpError(response, description)
⇒HttpError
.getS3LikeProviderBaseUrl(configuration)
⇒String
.newError(message, code)
⇒Error
.parseDn(seq)
⇒Map<String | String>
.parseJson(result)
⇒Promise<any>
.parseXml(data)
⇒XElement
.safeGetHeader(response, headerKey)
⇒any
.safeStringifyJson(data, skippedNames)
⇒String
BaseS3Options
⇐ PublishConfiguration
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
-
channel
=latest
String | "undefined" - The update channel. -
path
=/
String | "undefined" - The directory path. -
acl
=public-read
"private" | "public-read" | "undefined" - The ACL. Set tonull
to not add. -
provider
"github" | "bintray" | "s3" | "spaces" | "generic" | "custom" | "snapStore" | "keygen" - The provider. -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
BintrayOptions
⇐ PublishConfiguration
Bintray options. Requires an API key. An API key can be obtained from the user profile page ("Edit Your Profile" -> API Key).
Define BT_TOKEN
environment variable.
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
-
provider
"bintray" - The provider. Must bebintray
. -
package
String | "undefined" - The Bintray package name. -
repo
=generic
String | "undefined" - The Bintray repository name. -
owner
String | "undefined" - The owner. -
component
String | "undefined" - The Bintray component (Debian only). -
distribution
=stable
String | "undefined" - The Bintray distribution (Debian only). -
user
String | "undefined" - The Bintray user account. Used in cases where the owner is an organization. -
token
String | "undefined" -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
Kind: interface of builder-util-runtime
Properties
version
"1" | "2"files
Array<module:builder-util-runtime/out/blockMapApi.BlockMapFile>
Kind: interface of builder-util-runtime
Properties
size
Number - The file size. Used to verify downloaded size (save one HTTP request to get length). Also used when block map data is embedded into the file (appimage, windows web installer package).blockMapSize
Number - The block map file size. Used when block map data is embedded into the file (appimage, windows web installer package). This information can be obtained from the file itself, but it requires additional HTTP request, so, to reduce request count, block map size is specified in the update metadata too.sha512
String - The file checksum.isAdminRightsRequired
Boolean
CustomPublishOptions
⇐ PublishConfiguration
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
-
provider
"custom" - The provider. Must becustom
. -
updateProvider
module:builder-util-runtime/out/publishOptions.__type - The Provider to provide UpdateInfo regarding available updates. Required to use custom providers with electron-updater. -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
Kind: interface of builder-util-runtime
Properties
headers
[key: string]: string | "undefined"sha2
String | "undefined"sha512
String | "undefined"cancellationToken
CancellationTokenonProgress
callback
GenericServerOptions
⇐ PublishConfiguration
Generic (any HTTP(S) server) options. In all publish options File Macros are supported.
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
-
provider
"generic" - The provider. Must begeneric
. -
url
String - The base url. e.g.https://bucket_name.s3.amazonaws.com
. -
channel
=latest
String | "undefined" - The channel. -
useMultipleRangeRequest
Boolean - Whether to use multiple range requests for differential update. Defaults totrue
ifurl
doesn't contains3.amazonaws.com
. -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
GithubOptions
⇐ PublishConfiguration
GitHub options.
GitHub personal access token is required. You can generate by going to https://github.com/settings/tokens/new. The access token should have the repo scope/permission.
Define GH_TOKEN
environment variable.
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
-
provider
"github" - The provider. Must begithub
. -
repo
String | "undefined" - The repository name. Detected automatically. -
owner
String | "undefined" - The owner. -
vPrefixedTagName
=true
Boolean - Whether to usev
-prefixed tag name. -
host
=github.com
String | "undefined" - The host (including the port if need). -
protocol
=https
"https" | "http" | "undefined" - The protocol. GitHub Publisher supports onlyhttps
. -
token
String | "undefined" - The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for setFeedURL. -
private
Boolean | "undefined" - Whether to use private github auto-update provider ifGH_TOKEN
environment variable is defined. See Private GitHub Update Repo. -
releaseType
=draft
"draft" | "prerelease" | "release" | "undefined" - The type of release. By defaultdraft
release will be created.Also you can set release type using environment variable. If
EP_DRAFT
is set totrue
—draft
, ifEP_PRE_RELEASE
is set totrue
—prerelease
. -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
KeygenOptions
⇐ PublishConfiguration
Keygen options.
https://keygen.sh/
Define KEYGEN_TOKEN
environment variable.
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
-
provider
"keygen" - The provider. Must bekeygen
. -
account
String - Keygen account's UUID -
product
String - Keygen product's UUID -
channel
=stable
"stable" | "rc" | "beta" | "alpha" | "dev" | "undefined" - The channel. -
platform
String | "undefined" - The target Platform. Is set programmatically explicitly during publishing. -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
PackageFileInfo
⇐ BlockMapDataHolder
Kind: interface of builder-util-runtime
Extends: BlockMapDataHolder
Properties
path
String
Kind: interface of builder-util-runtime
Properties
total
Numberdelta
Numbertransferred
Numberpercent
NumberbytesPerSecond
Number
Kind: interface of builder-util-runtime
Properties
-
provider
"github" | "bintray" | "s3" | "spaces" | "generic" | "custom" | "snapStore" | "keygen" - The provider. -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
Kind: interface of builder-util-runtime
Properties
version
String - The version.note
String | "undefined" - The note.
Kind: interface of builder-util-runtime
Extends: [key: string]: OutgoingHttpHeader | undefined
S3Options
⇐ BaseS3Options
Kind: interface of builder-util-runtime
Extends: BaseS3Options
Properties
-
provider
"s3" - The provider. Must bes3
. -
bucket
String - The bucket name. -
region
String | "undefined" - The region. Is determined and set automatically when publishing. -
acl
=public-read
"private" | "public-read" | "undefined" - The ACL. Set tonull
to not add.Please see required permissions for the S3 provider.
-
storageClass
=STANDARD
"STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | "undefined" - The type of storage to use for the object. -
encryption
"AES256" | "aws:kms" | "undefined" - Server-side encryption algorithm to use for the object. -
endpoint
String | "undefined" - The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string likehttps://{service}.{region}.amazonaws.com
.
SnapStoreOptions
⇐ PublishConfiguration
Snap Store options.
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
-
provider
"snapStore" - The provider. Must besnapStore
. -
repo
String - snapcraft repo name -
channels
=["edge"]
String | Array<String> | "undefined" - The list of channels the snap would be released. -
publishAutoUpdate
=true
Boolean - Whether to publish auto update info files.Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
-
requestHeaders
[key: string]: string - Any custom request headers
SpacesOptions
⇐ BaseS3Options
DigitalOcean Spaces options.
Access key is required, define DO_KEY_ID
and DO_SECRET_KEY
environment variables.
Kind: interface of builder-util-runtime
Extends: BaseS3Options
Properties
provider
"spaces" - The provider. Must bespaces
.name
String - The space name.region
String - The region (e.g.nyc3
).
UpdateFileInfo
⇐ BlockMapDataHolder
Kind: interface of builder-util-runtime
Extends: BlockMapDataHolder
Properties
url
String
Kind: interface of builder-util-runtime
Properties
version
String - The version.files
Array<UpdateFileInfo>path
String - Deprecated: {tag.description}sha512
String - Deprecated: {tag.description}releaseName
String | "undefined" - The release name.releaseNotes
String | Array<ReleaseNoteInfo> | "undefined" - The release notes. List ifupdater.fullChangelog
is set totrue
,string
otherwise.releaseDate
String - The release date.stagingPercentage
Number - The staged rollout percentage, 0-100.
WindowsUpdateInfo
⇐ UpdateInfo
Kind: interface of builder-util-runtime
Extends: UpdateInfo
Properties
packages
Object<String, any> | "undefined"
Kind: class of builder-util-runtime
Extends: Error
Kind: class of builder-util-runtime
Extends: module:events.EventEmitter
Properties
cancelled
Boolean
Methods
- .CancellationToken ⇐
module:events.EventEmitter
.cancel()
.createPromise(callback)
⇒Promise<module:builder-util-runtime/out/CancellationToken.R>
.dispose()
cancellationToken.createPromise(callback)
⇒ Promise<module:builder-util-runtime/out/CancellationToken.R>
- callback
callback
Kind: class of builder-util-runtime
Extends: internal:Transform
Properties
actual
StringisValidateOnEnd
=true
Boolean
Methods
- .DigestTransform ⇐
internal:Transform
- callback
any
- chunk
module:global.Buffer
- encoding
String
- callback
any
Kind: class of builder-util-runtime
Extends: Error
Kind: class of builder-util-runtime
- .HttpExecutor
.addErrorAndTimeoutHandlers(request, reject)
.createRequest(options, callback)
⇒module:builder-util-runtime/out/httpExecutor.T
.doApiRequest(options, cancellationToken, requestProcessor, redirectCount)
⇒Promise<String>
.downloadToBuffer(url, options)
⇒Promise<module:global.Buffer>
.prepareRedirectUrlOptions(redirectUrl, options)
⇒module:http.RequestOptions
.request(options, cancellationToken, data)
⇒Promise< | String>
.retryOnServerError(task, maxRetries)
⇒Promise<any>
- request
any
- reject
callback
- options
any
- callback
callback
httpExecutor.doApiRequest(options, cancellationToken, requestProcessor, redirectCount)
⇒ Promise<String>
- options
module:http.RequestOptions
- cancellationToken
CancellationToken
- requestProcessor
callback
- redirectCount
- url
module:url.URL
- options
DownloadOptions
- redirectUrl
String
- options
module:http.RequestOptions
- options
module:http.RequestOptions
- cancellationToken
CancellationToken
- data
Object<String, any>
|"undefined"
- task
callback
- maxRetries
Kind: class of builder-util-runtime
Extends: internal:Transform
- .ProgressCallbackTransform ⇐
internal:Transform
- callback
any
- chunk
any
- encoding
String
- callback
any
Kind: class of builder-util-runtime
Properties
OID
=UUID.parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8")
module:global.Buffer
Methods
- .UUID
.check(uuid, offset)
⇒"undefined"
|module:builder-util-runtime/out/uuid.__object
|module:builder-util-runtime/out/uuid.__object
.inspect()
⇒String
.parse(input)
⇒module:global.Buffer
.toString()
⇒String
.v5(name, namespace)
⇒any
uuiD.check(uuid, offset)
⇒ "undefined"
| module:builder-util-runtime/out/uuid.__object
| module:builder-util-runtime/out/uuid.__object
- uuid
module:global.Buffer
|String
- offset
- input
String
- name
String
|module:global.Buffer
- namespace
module:global.Buffer
Kind: class of builder-util-runtime
Properties
value=
Stringattributes
Object<String, any> | "undefined"isCData
=false
Booleanelements
Array<XElement> | "undefined"
Methods
- name
String
xElement.element(name, ignoreCase, errorIfMissed)
⇒ XElement
- name
String
- ignoreCase
- errorIfMissed
String
|"undefined"
xElement.elementOrNull(name, ignoreCase)
⇒ null
| XElement
- name
String
- ignoreCase
xElement.getElements(name, ignoreCase)
⇒ Array<XElement>
- name
String
- ignoreCase
- name
String
- ignoreCase
- name
String
Kind: method of builder-util-runtime
- v
"undefined"
|undefined
|module:builder-util-runtime.T
|Array<module:builder-util-runtime.T>
Kind: method of builder-util-runtime
- options
module:http.RequestOptions
- token
String
|"undefined"
- method
"GET"
|"DELETE"
|"PUT"
Kind: method of builder-util-runtime
- url
String
- options
module:http.RequestOptions
Kind: method of builder-util-runtime
- url
module:url.URL
- options
module:http.RequestOptions
builder-util-runtime.createHttpError(response, description)
⇒ HttpError
Kind: method of builder-util-runtime
- response
module:http.IncomingMessage
- description
any
|"undefined"
Kind: method of builder-util-runtime
- configuration
PublishConfiguration
Kind: method of builder-util-runtime
- message
String
- code
String
Kind: method of builder-util-runtime
- seq
String
Kind: method of builder-util-runtime
- result
Promise< | String>
builder-util-runtime.parseXml(data)
⇒ XElement
Kind: method of builder-util-runtime
- data
String
Kind: method of builder-util-runtime
- response
any
- headerKey
String
Kind: method of builder-util-runtime
- data
any
- skippedNames
Set<String>
- electron-updater
.Logger
.ResolvedUpdateFileInfo
.UpdateCheckResult
.UpdateDownloadedEvent
⇐module:builder-util-runtime.UpdateInfo
- .AppImageUpdater ⇐
module:electron-updater/out/BaseUpdater.BaseUpdater
.isUpdaterActive()
⇒Boolean
- .AppUpdater ⇐
module:events.EventEmitter
.addAuthHeader(token)
.checkForUpdates()
⇒Promise<UpdateCheckResult>
.checkForUpdatesAndNotify(downloadNotification)
⇒Promise< | UpdateCheckResult>
.downloadUpdate(cancellationToken)
⇒Promise<Array<String>>
.getFeedURL()
⇒undefined
|null
|String
.setFeedURL(options)
.isUpdaterActive()
⇒Boolean
.quitAndInstall(isSilent, isForceRunAfter)
- .MacUpdater ⇐
AppUpdater
.quitAndInstall()
.addAuthHeader(token)
.checkForUpdates()
⇒Promise<UpdateCheckResult>
.checkForUpdatesAndNotify(downloadNotification)
⇒Promise< | UpdateCheckResult>
.downloadUpdate(cancellationToken)
⇒Promise<Array<String>>
.getFeedURL()
⇒undefined
|null
|String
.setFeedURL(options)
.isUpdaterActive()
⇒Boolean
- .NsisUpdater ⇐
module:electron-updater/out/BaseUpdater.BaseUpdater
- .Provider
.getLatestVersion()
⇒Promise<module:electron-updater/out/providers/Provider.T>
.setRequestHeaders(value)
.resolveFiles(updateInfo)
⇒Array<ResolvedUpdateFileInfo>
- .UpdaterSignal
.autoUpdater
:AppUpdater
.DOWNLOAD_PROGRESS
:"login"
|"checking-for-update"
|"update-available"
|"update-not-available"
|"update-cancelled"
|"download-progress"
|"update-downloaded"
|"error"
.UPDATE_DOWNLOADED
:"login"
|"checking-for-update"
|"update-available"
|"update-not-available"
|"update-cancelled"
|"download-progress"
|"update-downloaded"
|"error"
Kind: interface of electron-updater
- message
String
- message
any
- message
any
- message
any
Kind: interface of electron-updater
Properties
url
module:url.URLinfo
module:builder-util-runtime.UpdateFileInfopackageInfo
module:builder-util-runtime.PackageFileInfo
Kind: interface of electron-updater
Properties
updateInfo
module:builder-util-runtime.UpdateInfodownloadPromise
Promise<Array<String>> | "undefined"cancellationToken
CancellationTokenversionInfo
module:builder-util-runtime.UpdateInfo - Deprecated: {tag.description}
Kind: interface of electron-updater
Extends: module:builder-util-runtime.UpdateInfo
Properties
downloadedFile
String
Kind: class of electron-updater
Extends: module:electron-updater/out/BaseUpdater.BaseUpdater
Kind: class of electron-updater
Extends: module:events.EventEmitter
Properties
-
autoDownload
=true
Boolean - Whether to automatically download an update when it is found. -
autoInstallOnAppQuit
=true
Boolean - Whether to automatically install a downloaded update on app quit (ifquitAndInstall
was not called before). -
allowPrerelease
=false
Boolean - GitHub provider only. Whether to allow update to pre-release versions. Defaults totrue
if application version contains prerelease components (e.g.0.12.1-alpha.1
, herealpha
is a prerelease component), otherwisefalse
.If
true
, downgrade will be allowed (allowDowngrade
will be set totrue
). -
fullChangelog
=false
Boolean - GitHub provider only. Get all release notes (from current version to latest), not just the latest. -
allowDowngrade
=false
Boolean - Whether to allow version downgrade (when a user from the beta channel wants to go back to the stable channel).Taken in account only if channel differs (pre-release version component in terms of semantic versioning).
-
currentVersion
SemVer - The current application version. -
channel
String | "undefined" - Get the update channel. Not applicable for GitHub. Doesn't returnchannel
from the update configuration, only if was previously set. -
requestHeaders
[key: string]: string | "undefined" - The request headers. -
netSession
Electron:Session -
logger
Logger | "undefined" - The logger. You can pass electron-log, winston or another logger with the following interface:{ info(), warn(), error() }
. Set it tonull
if you would like to disable a logging feature. -
signals
=new UpdaterSignal(this)
UpdaterSignal -
configOnDisk
=new Lazy<any>(() => this.loadUpdateConfig())
Lazy<any> -
httpExecutor
module:electron-updater/out/electronHttpExecutor.ElectronHttpExecutor -
isAddNoCacheQuery
Boolean
Methods
- .AppUpdater ⇐
module:events.EventEmitter
.addAuthHeader(token)
.checkForUpdates()
⇒Promise<UpdateCheckResult>
.checkForUpdatesAndNotify(downloadNotification)
⇒Promise< | UpdateCheckResult>
.downloadUpdate(cancellationToken)
⇒Promise<Array<String>>
.getFeedURL()
⇒undefined
|null
|String
.setFeedURL(options)
.isUpdaterActive()
⇒Boolean
.quitAndInstall(isSilent, isForceRunAfter)
Shortcut for explicitly adding auth tokens to request headers
- token
String
appUpdater.checkForUpdates()
⇒ Promise<UpdateCheckResult>
Asks the server whether there is an update.
appUpdater.checkForUpdatesAndNotify(downloadNotification)
⇒ Promise< | UpdateCheckResult>
- downloadNotification
module:electron-updater/out/AppUpdater.DownloadNotification
Start downloading update manually. You can use this method if autoDownload
option is set to false
.
Returns: Promise<Array<String>>
- Paths to downloaded files.
- cancellationToken
CancellationToken
Configure update provider. If value is string
, GenericServerOptions will be set with value as url
.
- options
PublishConfiguration
|String
|GithubOptions
|S3Options
|SpacesOptions
|GenericServerOptions
|BintrayOptions
|module:builder-util-runtime/out/publishOptions.CustomPublishOptions
|module:builder-util-runtime/out/publishOptions.KeygenOptions
|SnapStoreOptions
|String
- If you want to override configuration in theapp-update.yml
.
Restarts the app and installs the update after it has been downloaded.
It should only be called after update-downloaded
has been emitted.
Note: autoUpdater.quitAndInstall()
will close all application windows first and only emit before-quit
event on app
after that.
This is different from the normal quit event sequence.
- isSilent
Boolean
- windows-only Runs the installer in silent mode. Defaults tofalse
. - isForceRunAfter
Boolean
- Run the app after finish even on silent install. Not applicable for macOS. Ignored ifisSilent
is set tofalse
.
MacUpdater ⇐ AppUpdater
Kind: class of electron-updater
Extends: AppUpdater
- .MacUpdater ⇐
AppUpdater
.quitAndInstall()
.addAuthHeader(token)
.checkForUpdates()
⇒Promise<UpdateCheckResult>
.checkForUpdatesAndNotify(downloadNotification)
⇒Promise< | UpdateCheckResult>
.downloadUpdate(cancellationToken)
⇒Promise<Array<String>>/code>
.getFeedURL()
⇒undefined
|null
|String
.setFeedURL(options)
.isUpdaterActive()
⇒Boolean
Overrides: quitAndInstall
Shortcut for explicitly adding auth tokens to request headers
- token
String
macUpdater.checkForUpdates()
⇒ Promise<UpdateCheckResult>
Asks the server whether there is an update.
macUpdater.checkForUpdatesAndNotify(downloadNotification)
⇒ Promise< | UpdateCheckResult>
- downloadNotification
module:electron-updater/out/AppUpdater.DownloadNotification
Start downloading update manually. You can use this method if autoDownload
option is set to false
.
Returns: Promise<Array<String>>
- Paths to downloaded files.
- cancellationToken
CancellationToken
Configure update provider. If value is string
, GenericServerOptions will be set with value as url
.
- options
PublishConfiguration
| String
| GithubOptions
| S3Options
| SpacesOptions
| GenericServerOptions
| BintrayOptions
| module:builder-util-runtime/out/publishOptions.CustomPublishOptions
| module:builder-util-runtime/out/publishOptions.KeygenOptions
| SnapStoreOptions
| String
- If you want to override configuration in the app-update.yml
.
Kind: class of electron-updater
Extends: module:electron-updater/out/BaseUpdater.BaseUpdater
Kind: class of electron-updater
Properties
isUseMultipleRangeRequest
Boolean
fileExtraDownloadHeaders
[key: string]: string | "undefined"
Methods
- .Provider
.getLatestVersion()
⇒ Promise<module:electron-updater/out/providers/Provider.T>
.setRequestHeaders(value)
.resolveFiles(updateInfo)
⇒ Array<ResolvedUpdateFileInfo>
- value
[key: string]: string
| "undefined"
provider.resolveFiles(updateInfo)
⇒ Array<ResolvedUpdateFileInfo>
- updateInfo
module:electron-updater/out/providers/Provider.T
Kind: class of electron-updater
Emitted when an authenticating proxy is asking for user credentials.
- handler
module:electron-updater.__type
- handler
callback
- handler
callback
- handler
callback
electron-updater.autoUpdater
: AppUpdater
Kind: constant of electron-updater
electron-updater.DOWNLOAD_PROGRESS
: "login"
| "checking-for-update"
| "update-available"
| "update-not-available"
| "update-cancelled"
| "download-progress"
| "update-downloaded"
| "error"
Kind: constant of electron-updater
electron-updater.UPDATE_DOWNLOADED
: "login"
| "checking-for-update"
| "update-available"
| "update-not-available"
| "update-cancelled"
| "download-progress"
| "update-downloaded"
| "error"
Kind: constant of electron-updater