Skip to content

ElectronAutoUpdater

Unofficial

Enables apps to automatically update themselves.

Import:

import type { ElectronAutoUpdater } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ElectronAutoUpdater extends NodeJS.EventEmitter

Extends: NodeJS.EventEmitter

Methods

MethodReturnsDescription
addListener(event, listener)thisRegisters a listener for the given auto updater event.
addListener(event, listener)thisRegisters a listener for the checking-for-update event.
addListener(event, listener)thisRegisters a listener for the error event.
addListener(event, listener)thisRegisters a listener for the update-available event.
addListener(event, listener)thisRegisters a listener for the update-downloaded event.
addListener(event, listener)thisRegisters a listener for the update-not-available event.
checkForUpdates()voidAsks the server whether there is an update. You must call setFeedURL before using this API.

**Note:** If an update is available it will be downloaded automatically. Calling autoUpdater.checkForUpdates() twice will download the update two times.
getFeedURL()stringThe current update feed URL.
on('before-quit-for-update', listener)thisRegisters a listener for the given auto updater event.
on('checking-for-update', listener)thisRegisters a listener for the checking-for-update event.
on('error', listener)thisRegisters a listener for the error event.
on('update-available', listener)thisRegisters a listener for the update-available event.
on('update-downloaded', listener)thisRegisters a listener for the update-downloaded event.
on('update-not-available', listener)thisRegisters a listener for the update-not-available event.
once(event, listener)thisRegisters a one-time listener for the given auto updater event.
once(event, listener)thisRegisters a one-time listener for the checking-for-update event.
once(event, listener)thisRegisters a one-time listener for the error event.
once(event, listener)thisRegisters a one-time listener for the update-available event.
once(event, listener)thisRegisters a one-time listener for the update-downloaded event.
once(event, listener)thisRegisters a one-time listener for the update-not-available event.
quitAndInstall()voidRestarts the app and installs the update after it has been downloaded. It should only be called after update-downloaded has been emitted.

Under the hood calling autoUpdater.quitAndInstall() will close all application windows first, and automatically call app.quit() after all windows have been closed.
removeListener(event, listener)thisRemoves the given listener for the given auto updater event.
removeListener(event, listener)thisRemoves the listener for the checking-for-update event.
removeListener(event, listener)thisRemoves the listener for the error event.
removeListener(event, listener)thisRemoves the listener for the update-available event.
removeListener(event, listener)thisRemoves the listener for the update-downloaded event.
removeListener(event, listener)thisRemoves the listener for the update-not-available event.
setFeedURL(options)voidSets the url and initialize the auto updater.

Links to this page: