From 45b626e0cc6fa8411edf4681f110b4cf88d4bc34 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 2 Feb 2014 20:37:46 +0800 Subject: [PATCH] :memo: Add docs on new auto updater API. --- docs/api/browser/auto-updater.md | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/api/browser/auto-updater.md b/docs/api/browser/auto-updater.md index d78a8720..903dbc22 100644 --- a/docs/api/browser/auto-updater.md +++ b/docs/api/browser/auto-updater.md @@ -1,42 +1,42 @@ # auto-updater -`auto-updater` module is a simple wrap around the Sparkle framework, it -provides auto update service for the application. +The `auto-updater` module is a simple wrap around the +[Squirrel](https://github.com/Squirrel/Squirrel.Mac) framework, you should +follow Squirrel's instructions on setting the server. -Before using this module, you should edit the `Info.plist` following -https://github.com/andymatuschak/Sparkle/wiki. +## Event: checking-for-update -## Event: will-install-update +Emitted when checking for update has started. -* `event` Event -* `version` String -* `continueUpdate` Function +## Event: update-available + +Emitted when there is an available update, the update would be downloaded +automatically. + +## Event: update-not-available -This event is emitted when the update is found and going to be installed. -Calling `event.preventDefault()` would pause it, and you can call -`continueUpdate` to continue the update. +Emitted when there is no available update. -## Event: ready-for-update-on-quit +## Event: update-downloaded * `event` Event -* `version` String +* `releaseNotes` String +* `releaseName` String +* `releaseDate` Date +* `updateUrl` String * `quitAndUpdate` Function -This event is emitted when user chose to delay the update until the quit. -Calling `quitAndUpdate()` would quit the application and install the update. +Emitted when update has been downloaded, calling `quitAndUpdate()` would restart +the application and install the update. ## autoUpdater.setFeedUrl(url) * `url` String -## autoUpdater.setAutomaticallyChecksForUpdates(flag) - -* `flag` Boolean - -## autoUpdater.setAutomaticallyDownloadsUpdates(flag) - -* `flag` Boolean +Set the `url` and initialize the auto updater. The `url` could not be changed +once it is set. ## autoUpdater.checkForUpdates() -## autoUpdater.checkForUpdatesInBackground() +Ask the server whether there is an update, you have to call `setFeedUrl` before +using this API. -- 2.43.0