Skip to main content
The electron-updater module provides auto-update functionality for Electron applications on macOS, Windows, and Linux.

Installation

Quick Start

autoUpdater

The main auto-updater instance, automatically configured based on the current platform.
  • On Windows: Uses NsisUpdater
  • On macOS: Uses MacUpdater
  • On Linux: Uses AppImageUpdater, DebUpdater, RpmUpdater, or PacmanUpdater based on package type

AppUpdater Class

Base class for all platform-specific updaters. Source: packages/electron-updater/src/AppUpdater.ts:52

Properties

boolean
default:"true"
Whether to automatically download an update when found.
boolean
default:"true"
Whether to automatically install a downloaded update on app quit.
boolean
default:"true"
Whether to run the app after install when installer is NOT in silent mode.
boolean
default:"false"
Whether to allow update to pre-release versions. Defaults to true if the application version contains prerelease components.
boolean
default:"false"
GitHub provider only. Get all release notes from current version to latest, not just the latest.
boolean
default:"false"
Whether to allow version downgrade (when a user from beta channel wants to go back to stable channel).
boolean
default:"false"
Web installer files might not have signature verification, this prevents loading them unless needed.
boolean
default:"false"
NSIS only. Disable differential downloads and always perform full download of installer.
boolean
default:"false"
Allows developer to force the updater to work in “dev” mode, looking for dev-app-update.yml instead of app-update.yml.
string | null
The update channel. Overrides channel in the update configuration. Setting this automatically sets allowDowngrade to true.
SemVer
The current application version.
OutgoingHttpHeaders | null
Custom request headers.
Logger | null
The logger. Can be electron-log, winston, or any logger with info(), warn(), error() methods. Set to null to disable logging.

Methods

checkForUpdates()

Checks if there is an update available.
Returns: Promise<UpdateCheckResult | null> - Returns null if updater is disabled, otherwise update information. Example:

checkForUpdatesAndNotify()

Checks for updates and shows a notification when download completes.
DownloadNotification
Custom notification configuration.
Example:

downloadUpdate()

Downloads an update. Call this if autoDownload is false.
CancellationToken
Token to cancel the download.
Returns: Promise<Array<string>> - Paths to downloaded files. Example:

quitAndInstall()

Restarts the app and installs the update.
boolean
default:"false"
Windows only. Runs the installer in silent mode.
boolean
default:"false"
Run the app after install even on silent install. Not applicable for macOS. Ignored if isSilent is false.
Example:

setFeedURL()

Configures the update provider.
PublishConfiguration | AllPublishOptions | string
required
Provider configuration or URL string for generic provider.
Example:

addAuthHeader()

Adds an authorization header to requests.
string
required
Authorization token (e.g., "Bearer <token>" or "token <token>").
Example:

Events

The AppUpdater class extends EventEmitter with typed events.

checking-for-update

Emitted when checking for updates starts.

update-available

Emitted when an update is available.
Example:

update-not-available

Emitted when no update is available.

download-progress

Emitted during download progress.
ProgressInfo properties:
  • total: number - Total bytes
  • delta: number - Delta bytes since last event
  • transferred: number - Transferred bytes
  • percent: number - Progress percentage
  • bytesPerSecond: number - Download speed
Example:

update-downloaded

Emitted when update has been downloaded.
Example:

update-cancelled

Emitted when update download is cancelled.

error

Emitted when an error occurs.
Example:

Platform-Specific Updaters

NsisUpdater

Windows NSIS installer updater.

MacUpdater

macOS updater (supports DMG and ZIP).

AppImageUpdater

Linux AppImage updater.

DebUpdater

Linux Debian package updater.

RpmUpdater

Linux RPM package updater.

PacmanUpdater

Linux Pacman package updater.

Complete Example

TypeScript Support

See Also