Skip to content

domain/updates/update-service

Defined in: app/src/domain/updates/update-service.ts:96

Checks for updates on a schedule and downloads them in the background. A downloaded update installs when the browser quits. The service never shows a dialog.

new UpdateService(engine, clock, logger, options): UpdateService

Defined in: app/src/domain/updates/update-service.ts:116

UpdateEngine

Finds, downloads and installs updates.

Clock

Time and timers.

Logger

Logger.

UpdateServiceOptions

Policies and installation facts.

UpdateService

readonly onDidChange: Event<UpdateState>

Defined in: app/src/domain/updates/update-service.ts:108

Fires whenever UpdateService.state changes.

get state(): UpdateState

Defined in: app/src/domain/updates/update-service.ts:133

The current state.

UpdateState

check(): Promise<UpdateState>

Defined in: app/src/domain/updates/update-service.ts:147

Checks now and downloads an update if there is one. Concurrent calls share one run.

Promise<UpdateState>

The state after the run.

dispose(): void

Defined in: app/src/domain/updates/update-service.ts:170

Cancels the schedule.

void

Disposable.dispose

installOnExit(): boolean

Defined in: app/src/domain/updates/update-service.ts:161

Installs a downloaded update while the browser exits.

boolean

Whether an installation started.

start(): void

Defined in: app/src/domain/updates/update-service.ts:138

Schedules the first automatic check, unless updates are off or manual.

void

Defined in: app/src/domain/updates/update-service.ts:37

Finds, downloads and installs verified updates; electron-updater in the browser.

check(): Promise<string | undefined>

Defined in: app/src/domain/updates/update-service.ts:42

Looks for a newer version in the signed feed.

Promise<string | undefined>

The version, or undefined when the browser is up to date.

download(onProgress): Promise<void>

Defined in: app/src/domain/updates/update-service.ts:47

Downloads the update found by the last check and verifies it.

(percent) => void

Receives the progress in percent.

Promise<void>

install(): void

Defined in: app/src/domain/updates/update-service.ts:52

Starts the silent installation of the downloaded update. Called while the browser exits, after everything is saved.

void


Defined in: app/src/domain/updates/update-service.ts:56

Work around an installation that keeps a rollback possible.

afterDownload(version): Promise<void>

Defined in: app/src/domain/updates/update-service.ts:62

Runs after a download while the browser keeps running, such as fetching the package of the running version. A failure is logged; the update still installs.

string

The downloaded version.

Promise<void>

beforeInstall(version): void

Defined in: app/src/domain/updates/update-service.ts:67

Runs right before the installation starts, while the browser exits.

string

The version being installed.

void


Defined in: app/src/domain/updates/update-service.ts:71

Settings of the update service, resolved from policies and the installation.

readonly hasKeys: boolean

Defined in: app/src/domain/updates/update-service.ts:75

Whether the build carries update keys; without them, nothing can be verified.

readonly optional hooks?: UpdateHooks

Defined in: app/src/domain/updates/update-service.ts:83

Rollback preparation around downloads and installations.

readonly installType: InstallType

Defined in: app/src/domain/updates/update-service.ts:73

readonly isOnline: () => boolean

Defined in: app/src/domain/updates/update-service.ts:79

Whether the system reports a network connection.

boolean

readonly mode: UpdateMode

Defined in: app/src/domain/updates/update-service.ts:72

readonly periodMinutes: number

Defined in: app/src/domain/updates/update-service.ts:77

Minutes between automatic checks.

readonly optional random?: () => number

Defined in: app/src/domain/updates/update-service.ts:81

Random number in [0, 1) for the jitter; replaceable in tests.

number

InstallType = "nsis" | "msi" | "mac" | "appimage" | "deb" | "rpm" | "unpacked"

Defined in: app/src/domain/updates/update-service.ts:8

How the browser was installed, which decides who installs updates.


UpdateMode = "off" | "automatic" | "manual"

Defined in: app/src/domain/updates/update-service.ts:20

The UpdatePolicy values: off, automatic, or only when the user asks.


UpdateState = { kind: "disabled"; reason: "policy" | "install-type" | "no-keys"; } | { kind: "idle"; lastCheckAt?: number; } | { kind: "checking"; } | { kind: "downloading"; percent: number; version: string; } | { kind: "ready"; version: string; } | { at: number; code: string; kind: "failed"; message: string; }

Defined in: app/src/domain/updates/update-service.ts:23

What the updater is doing.

const UpdateServiceToken: Token<UpdateService>

Defined in: app/src/domain/updates/update-service.ts:240

Token for the UpdateService.

updatesItself(type): boolean

Defined in: app/src/domain/updates/update-service.ts:15

Whether the browser installs updates of this installation type itself. IT updates MSI installations, and the package manager updates deb and rpm installations.

InstallType

The installation type.

boolean