diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index 828af310d..55a249a9f 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -20,10 +20,10 @@ class AutoUpdateManager process.nextTick => @setupAutoUpdater() setupAutoUpdater: -> - autoUpdater = require 'auto-updater' - if process.platform is 'win32' - autoUpdater.checkForUpdates = => @checkForUpdatesShim() + autoUpdater = require 'auto-updater-win32' + else + autoUpdater = require 'auto-updater' autoUpdater.setFeedUrl @feedUrl @@ -48,24 +48,6 @@ class AutoUpdateManager unless /\w{7}/.test(@version) @check(hidePopups: true) - # Windows doesn't have an auto-updater, so use this method to shim the events. - checkForUpdatesShim: -> - autoUpdater.emit 'checking-for-update' - - https = require 'https' - request = https.get @feedUrl, (response) -> - if response.statusCode == 200 - body = "" - response.on 'data', (chunk) -> body += chunk - response.on 'end', -> - {notes, name} = JSON.parse(body) - autoUpdater.emit 'update-downloaded', null, notes, name - else - autoUpdater.emit 'update-not-available' - - request.on 'error', (error) -> - autoUpdater.emit 'error', null, error.message - emitUpdateAvailableEvent: (windows...) -> return unless @releaseVersion? and @releaseNotes for atomWindow in windows diff --git a/src/browser/auto-updater-win32.coffee b/src/browser/auto-updater-win32.coffee new file mode 100644 index 000000000..83072a86a --- /dev/null +++ b/src/browser/auto-updater-win32.coffee @@ -0,0 +1,15 @@ +_ = require 'underscore-plus' +{EventEmitter} = require 'events' + +module.exports = +class AutoUpdater + _.extend @prototype, EventEmitter.prototype + + setFeedUrl: -> + console.log 'setFeedUrl' + + quitAndInstall: -> + console.log 'quitAndInstall' + + checkForUpdates: -> + console.log 'checkForUpdates'