Auto Update
See publish configuration for information on how to configure your local or CI environment for automated deployments.
Code signing is required on macOS
macOS application must be signed in order for auto updating to work.
Auto-updatable Targets¶
- macOS: DMG.
- Linux: AppImage.
- 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.)
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.
Differences between electron-updater and built-in autoUpdater¶
- 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.
Quick Setup Guide¶
-
Install electron-updater as an app dependency.
-
Use
autoUpdater
fromelectron-updater
instead ofelectron
:JavaScript
ES2015const { autoUpdater } = require("electron-updater")
import { autoUpdater } from "electron-updater"
-
Call
autoUpdater.checkForUpdatesAndNotify()
. Or, if you need custom behaviour, implementelectron-updater
events, check examples below.
Note
- Do not call setFeedURL. electron-builder automatically creates
app-update.yml
file for you on build in theresources
(this file is internal, you don’t need to be aware of it). zip
target for macOS is required for Squirrel.Mac, otherwiselatest-mac.yml
cannot be created, which causesautoUpdater
error. Default target for macOS isdmg
+zip
, so there is no need to explicitly specify target.
Examples¶
Example in TypeScript using system notifications
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.
Custom Options instantiating updater Directly¶
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()
}
}
Debugging¶
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.
Compatibility¶
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¶
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.
File Generated and Uploaded in Addition¶
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
).
Private GitHub Update Repo¶
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.
Events¶
The autoUpdater
object emits the following events:
Event: error
¶
error
Error
Emitted when there is an error while updating.
Event: checking-for-update
¶
Emitted when checking if an update has started.
Event: update-available
¶
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
.
Event: update-not-available
¶
Emitted when there is no available update.
info
UpdateInfo (for generic and github providers) | VersionInfo (for Bintray provider)
Event: download-progress
¶
progress
ProgressInfobytesPerSecond
percent
total
transferred
Emitted on progress.
Event: update-downloaded
¶
info
UpdateInfo — for generic and github providers. VersionInfo for Bintray provider.
API¶
builder-util-runtime¶
- 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 to null
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 be bintray
.
* 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
BlockMap
¶
Kind: interface of builder-util-runtime
Properties
* version
“1” | “2”
* files
Array<module:builder-util-runtime/out/blockMapApi.BlockMapFile>
BlockMapDataHolder
¶
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 be custom
.
* 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
DownloadOptions
¶
Kind: interface of builder-util-runtime
Properties
* headers
[key: string]: string | “undefined”
* sha2
String | “undefined”
* sha512
String | “undefined”
* cancellationToken
CancellationToken
* onProgress
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 be generic
.
* 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 to true
if url
doesn’t contain s3.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 be github
.
* repo
String | “undefined” - The repository name. Detected automatically.
* owner
String | “undefined” - The owner.
* vPrefixedTagName
= true
Boolean - Whether to use v
-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 only https
.
* 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 if GH_TOKEN
environment variable is defined. See Private GitHub Update Repo.
* releaseType
= draft
“draft” | “prerelease” | “release” | “undefined” - The type of release. By default draft
release will be created.
Also you can set release type using environment variable. If EP_DRAFT
is set to true
— draft
, if EP_PRE_RELEASE
is set to true
— 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 be keygen
.
* 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
ProgressInfo
¶
Kind: interface of builder-util-runtime
Properties
* total
Number
* delta
Number
* transferred
Number
* percent
Number
* bytesPerSecond
Number
PublishConfiguration
¶
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
ReleaseNoteInfo
¶
Kind: interface of builder-util-runtime
Properties
* version
String - The version.
* note
String | “undefined” - The note.
RequestHeaders
⇐ [key: string]: string
¶
Kind: interface of builder-util-runtime
Extends: [key: string]: string
S3Options
⇐ BaseS3Options
¶
Kind: interface of builder-util-runtime
Extends: BaseS3Options
Properties
* provider
“s3” - The provider. Must be s3
.
* 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 to null
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 like https://{service}.{region}.amazonaws.com
.
SnapStoreOptions
⇐ PublishConfiguration
¶
Snap Store options.
Kind: interface of builder-util-runtime
Extends: PublishConfiguration
Properties
* provider
“snapStore” - The provider. Must be snapStore
.
* 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 be spaces
.
* 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
UpdateInfo
¶
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 if updater.fullChangelog
is set to true
, 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”
CancellationError ⇐ Error
¶
Kind: class of builder-util-runtime
Extends: Error
CancellationToken ⇐ module:events.EventEmitter
¶
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.cancel()
¶
cancellationToken.createPromise(callback)
⇒ Promise<module:builder-util-runtime/out/CancellationToken.R>
¶
- callback
callback
cancellationToken.dispose()
¶
DigestTransform ⇐ internal:Transform
¶
Kind: class of builder-util-runtime
Extends: internal:Transform
Properties
* actual
String
* isValidateOnEnd
= true
Boolean
Methods
* .DigestTransform ⇐ internal:Transform
* ._flush(callback)
* ._transform(chunk, encoding, callback)
* .validate()
⇒ null
digestTransform._flush(callback)
¶
- callback
any
digestTransform._transform(chunk, encoding, callback)
¶
- chunk
module:global.Buffer
- encoding
String
- callback
any
digestTransform.validate()
⇒ null
¶
HttpError ⇐ Error
¶
Kind: class of builder-util-runtime
Extends: Error
httpError.isServerError()
⇒ Boolean
¶
HttpExecutor¶
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>
httpExecutor.addErrorAndTimeoutHandlers(request, reject)
¶
- request
any
- reject
callback
httpExecutor.createRequest(options, callback)
⇒ module:builder-util-runtime/out/httpExecutor.T
¶
- options
any
- callback
callback
httpExecutor.doApiRequest(options, cancellationToken, requestProcessor, redirectCount)
⇒ Promise<String>
¶
- options
module:http.RequestOptions
- cancellationToken
CancellationToken
- requestProcessor
callback
- redirectCount
httpExecutor.downloadToBuffer(url, options)
⇒ Promise<module:global.Buffer>
¶
- url
module:url.URL
- options
DownloadOptions
httpExecutor.prepareRedirectUrlOptions(redirectUrl, options)
⇒ module:http.RequestOptions
¶
- redirectUrl
String
- options
module:http.RequestOptions
httpExecutor.request(options, cancellationToken, data)
⇒ Promise< | String>
¶
- options
module:http.RequestOptions
- cancellationToken
CancellationToken
- data
Object<String, any>
|“undefined”
httpExecutor.retryOnServerError(task, maxRetries)
⇒ Promise<any>
¶
- task
callback
- maxRetries
ProgressCallbackTransform ⇐ internal:Transform
¶
Kind: class of builder-util-runtime
Extends: internal:Transform
- .ProgressCallbackTransform ⇐
internal:Transform
progressCallbackTransform._flush(callback)
¶
- callback
any
progressCallbackTransform._transform(chunk, encoding, callback)
¶
- chunk
any
- encoding
String
- callback
any
UUID¶
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
uuiD.inspect()
⇒ String
¶
uuiD.parse(input)
⇒ module:global.Buffer
¶
- input
String
uuiD.toString()
⇒ String
¶
uuiD.v5(name, namespace)
⇒ any
¶
- name
String
|module:global.Buffer
- namespace
module:global.Buffer
XElement¶
Kind: class of builder-util-runtime
Properties
* value=
String
* attributes
Object<String, any> | “undefined”
* isCData
= false
Boolean
* elements
Array<XElement> | “undefined”
Methods
* .XElement
* .attribute(name)
⇒ String
* .element(name, ignoreCase, errorIfMissed)
⇒ XElement
* .elementOrNull(name, ignoreCase)
⇒ null
| XElement
* .getElements(name, ignoreCase)
⇒ Array<XElement>
* .elementValueOrEmpty(name, ignoreCase)
⇒ String
* .removeAttribute(name)
xElement.attribute(name)
⇒ String
¶
- 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
xElement.elementValueOrEmpty(name, ignoreCase)
⇒ String
¶
- name
String
- ignoreCase
xElement.removeAttribute(name)
¶
- name
String
builder-util-runtime.asArray(v)
⇒ Array<module:builder-util-runtime.T>
¶
Kind: method of builder-util-runtime
- v
“undefined”
|undefined
|module:builder-util-runtime.T
|Array<module:builder-util-runtime.T>
builder-util-runtime.configureRequestOptions(options, token, method)
⇒ module:http.RequestOptions
¶
Kind: method of builder-util-runtime
- options
module:http.RequestOptions
- token
String
|“undefined”
- method
“GET”
|“DELETE”
|“PUT”
builder-util-runtime.configureRequestOptionsFromUrl(url, options)
⇒ module:http.RequestOptions
¶
Kind: method of builder-util-runtime
- url
String
- options
module:http.RequestOptions
builder-util-runtime.configureRequestUrl(url, options)
¶
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”
builder-util-runtime.getS3LikeProviderBaseUrl(configuration)
⇒ String
¶
Kind: method of builder-util-runtime
- configuration
PublishConfiguration
builder-util-runtime.newError(message, code)
⇒ Error
¶
Kind: method of builder-util-runtime
- message
String
- code
String
builder-util-runtime.parseDn(seq)
⇒ Map<String | String>
¶
Kind: method of builder-util-runtime
- seq
String
builder-util-runtime.parseJson(result)
⇒ Promise<any>
¶
Kind: method of builder-util-runtime
- result
Promise< | String>
builder-util-runtime.parseXml(data)
⇒ XElement
¶
Kind: method of builder-util-runtime
- data
String
builder-util-runtime.safeGetHeader(response, headerKey)
⇒ any
¶
Kind: method of builder-util-runtime
- response
any
- headerKey
String
builder-util-runtime.safeStringifyJson(data, skippedNames)
⇒ String
¶
Kind: method of builder-util-runtime
- data
any
- skippedNames
Set<String>
electron-updater¶
- 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”
Logger
¶
Kind: interface of electron-updater
logger.debug(message)
¶
- message
String
logger.error(message)
¶
- message
any
logger.info(message)
¶
- message
any
logger.warn(message)
¶
- message
any
ResolvedUpdateFileInfo
¶
Kind: interface of electron-updater
Properties
* url
module:url.URL
* info
module:builder-util-runtime.UpdateFileInfo
* packageInfo
module:builder-util-runtime.PackageFileInfo
UpdateCheckResult
¶
Kind: interface of electron-updater
Properties
* updateInfo
module:builder-util-runtime.UpdateInfo
* downloadPromise
Promise<Array<String>> | “undefined”
* cancellationToken
CancellationToken
* versionInfo
module:builder-util-runtime.UpdateInfo - Deprecated: {tag.description}
UpdateDownloadedEvent
⇐ module:builder-util-runtime.UpdateInfo
¶
Kind: interface of electron-updater
Extends: module:builder-util-runtime.UpdateInfo
Properties
* downloadedFile
String
AppImageUpdater ⇐ module:electron-updater/out/BaseUpdater.BaseUpdater
¶
Kind: class of electron-updater
Extends: module:electron-updater/out/BaseUpdater.BaseUpdater
appImageUpdater.isUpdaterActive()
⇒ Boolean
¶
AppUpdater ⇐ module:events.EventEmitter
¶
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 (if quitAndInstall
was not called before).
* allowPrerelease
= false
Boolean - GitHub provider only. Whether to allow update to pre-release versions. Defaults to true
if application version contains prerelease components (e.g. 0.12.1-alpha.1
, here alpha
is a prerelease component), otherwise false
.
If true
, downgrade will be allowed (allowDowngrade
will be set to true
).
* 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 return channel
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 to null
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)
appUpdater.addAuthHeader(token)
¶
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
appUpdater.downloadUpdate(cancellationToken)
⇒ Promise<Array<String>>
¶
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
appUpdater.getFeedURL()
⇒ undefined
| null
| String
¶
appUpdater.setFeedURL(options)
¶
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
.
appUpdater.isUpdaterActive()
⇒ Boolean
¶
appUpdater.quitAndInstall(isSilent, isForceRunAfter)
¶
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
macUpdater.quitAndInstall()
¶
Overrides: quitAndInstall
macUpdater.addAuthHeader(token)
¶
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
macUpdater.downloadUpdate(cancellationToken)
⇒ Promise<Array<String>>
¶
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
macUpdater.getFeedURL()
⇒ undefined
| null
| String
¶
macUpdater.setFeedURL(options)
¶
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
.
macUpdater.isUpdaterActive()
⇒ Boolean
¶
NsisUpdater ⇐ module:electron-updater/out/BaseUpdater.BaseUpdater
¶
Kind: class of electron-updater
Extends: module:electron-updater/out/BaseUpdater.BaseUpdater
Provider¶
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>
provider.getLatestVersion()
⇒ Promise<module:electron-updater/out/providers/Provider.T>
¶
provider.setRequestHeaders(value)
¶
- value
[key: string]: string
|“undefined”
provider.resolveFiles(updateInfo)
⇒ Array<ResolvedUpdateFileInfo>
¶
- updateInfo
module:electron-updater/out/providers/Provider.T
UpdaterSignal¶
Kind: class of electron-updater
updaterSignal.login(handler)
¶
Emitted when an authenticating proxy is asking for user credentials.
- handler
module:electron-updater.__type
updaterSignal.progress(handler)
¶
- handler
callback
updaterSignal.updateCancelled(handler)
¶
- handler
callback
updaterSignal.updateDownloaded(handler)
¶
- 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