2013-09-09 07:35:57 +00:00
|
|
|
# auto-updater
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
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.
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
## Event: checking-for-update
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
Emitted when checking for update has started.
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
## Event: update-available
|
|
|
|
|
|
|
|
Emitted when there is an available update, the update would be downloaded
|
|
|
|
automatically.
|
|
|
|
|
|
|
|
## Event: update-not-available
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
Emitted when there is no available update.
|
2013-08-14 22:43:35 +00:00
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
## Event: update-downloaded
|
2013-08-14 22:43:35 +00:00
|
|
|
|
|
|
|
* `event` Event
|
2014-02-02 12:37:46 +00:00
|
|
|
* `releaseNotes` String
|
|
|
|
* `releaseName` String
|
|
|
|
* `releaseDate` Date
|
|
|
|
* `updateUrl` String
|
2013-08-14 22:43:35 +00:00
|
|
|
* `quitAndUpdate` Function
|
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
Emitted when update has been downloaded, calling `quitAndUpdate()` would restart
|
|
|
|
the application and install the update.
|
2013-08-14 22:43:35 +00:00
|
|
|
|
|
|
|
## autoUpdater.setFeedUrl(url)
|
|
|
|
|
|
|
|
* `url` String
|
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
Set the `url` and initialize the auto updater. The `url` could not be changed
|
|
|
|
once it is set.
|
2013-08-14 22:43:35 +00:00
|
|
|
|
|
|
|
## autoUpdater.checkForUpdates()
|
|
|
|
|
2014-02-02 12:37:46 +00:00
|
|
|
Ask the server whether there is an update, you have to call `setFeedUrl` before
|
|
|
|
using this API.
|