AutoUpdater

external interface AutoUpdater : EventEmitter(source)

Functions

Link copied to clipboard
abstract fun addListener(event: AutoUpdaterEvent.ERROR, listener: (JsError) -> Unit)
abstract fun addListener(event: AutoUpdaterEvent.UPDATE_DOWNLOADED, listener: (event: Event<*>, releaseNotes: String, releaseName: String, releaseDate: Date, updateURL: String) -> Unit)
Link copied to clipboard
abstract fun checkForUpdates()

Asks the server whether there is an update. You must call setFeedURL before using this API.

Link copied to clipboard
Link copied to clipboard
abstract fun getFeedURL(): String

The current update feed URL.

Link copied to clipboard
Link copied to clipboard
abstract fun off(event: AutoUpdaterEvent.BEFORE_QUIT_FOR_UPDATE, listener: Function<Unit>)
abstract fun off(event: AutoUpdaterEvent.CHECKING_FOR_UPDATE, listener: Function<Unit>)
abstract fun off(event: AutoUpdaterEvent.ERROR, listener: (JsError) -> Unit)
abstract fun off(event: AutoUpdaterEvent.UPDATE_AVAILABLE, listener: Function<Unit>)
abstract fun off(event: AutoUpdaterEvent.UPDATE_DOWNLOADED, listener: (event: Event<*>, releaseNotes: String, releaseName: String, releaseDate: Date, updateURL: String) -> Unit)
abstract fun off(event: AutoUpdaterEvent.UPDATE_NOT_AVAILABLE, listener: Function<Unit>)
Link copied to clipboard
abstract fun on(event: AutoUpdaterEvent.BEFORE_QUIT_FOR_UPDATE, listener: Function<Unit>)

This event is emitted after a user calls quitAndInstall().

abstract fun on(event: AutoUpdaterEvent.CHECKING_FOR_UPDATE, listener: Function<Unit>)

Emitted when checking if an update has started.

abstract fun on(event: AutoUpdaterEvent.ERROR, listener: (JsError) -> Unit)

Emitted when there is an error while updating.

abstract fun on(event: AutoUpdaterEvent.UPDATE_AVAILABLE, listener: Function<Unit>)

Emitted when there is an available update. The update is downloaded automatically.

abstract fun on(event: AutoUpdaterEvent.UPDATE_DOWNLOADED, listener: (event: Event<*>, releaseNotes: String, releaseName: String, releaseDate: Date, updateURL: String) -> Unit)

Emitted when an update has been downloaded.

abstract fun on(event: AutoUpdaterEvent.UPDATE_NOT_AVAILABLE, listener: Function<Unit>)

Emitted when there is no available update.

Link copied to clipboard
abstract fun once(event: AutoUpdaterEvent.CHECKING_FOR_UPDATE, listener: Function<Unit>)
abstract fun once(event: AutoUpdaterEvent.ERROR, listener: (JsError) -> Unit)
abstract fun once(event: AutoUpdaterEvent.UPDATE_AVAILABLE, listener: Function<Unit>)
abstract fun once(event: AutoUpdaterEvent.UPDATE_DOWNLOADED, listener: (event: Event<*>, releaseNotes: String, releaseName: String, releaseDate: Date, updateURL: String) -> Unit)
abstract fun once(event: AutoUpdaterEvent.UPDATE_NOT_AVAILABLE, listener: Function<Unit>)
Link copied to clipboard
abstract fun quitAndInstall()

Restarts the app and installs the update after it has been downloaded. It should only be called after update-downloaded has been emitted.

Link copied to clipboard
abstract fun removeListener(event: AutoUpdaterEvent.ERROR, listener: (JsError) -> Unit)
abstract fun removeListener(event: AutoUpdaterEvent.UPDATE_DOWNLOADED, listener: (event: Event<*>, releaseNotes: String, releaseName: String, releaseDate: Date, updateURL: String) -> Unit)
Link copied to clipboard
abstract fun setFeedURL(options: FeedURLOptions)

Sets the url and initialize the auto updater.

Link copied to clipboard