Merge branch 'MarshallOfSound-master'

This commit is contained in:
Cheng Zhao 2016-04-26 11:15:56 +09:00
commit 570dc7ca9b
2 changed files with 22 additions and 4 deletions

View file

@ -12,6 +12,9 @@ function AutoUpdater () {
util.inherits(AutoUpdater, EventEmitter)
AutoUpdater.prototype.quitAndInstall = function () {
if (!this.updateAvailable) {
return this.emitError('No update available, can\'t quit and install')
}
squirrelUpdate.processStart()
return app.quit()
}
@ -33,8 +36,10 @@ AutoUpdater.prototype.checkForUpdates = function () {
return this.emitError(error)
}
if (update == null) {
this.updateAvailable = false
return this.emit('update-not-available')
}
this.updateAvailable = true
this.emit('update-available')
squirrelUpdate.update(this.updateURL, (error) => {
var date, releaseNotes, version