diff --git a/atom/browser/api/lib/auto-updater.coffee b/atom/browser/api/lib/auto-updater.coffee index 7d7feea7ac95..0b7e84ba7efe 100644 --- a/atom/browser/api/lib/auto-updater.coffee +++ b/atom/browser/api/lib/auto-updater.coffee @@ -1,8 +1,9 @@ switch process.platform - when 'darwin' - autoUpdater = process.atomBinding('auto_updater').autoUpdater when 'win32' - autoUpdater = require('./auto-updater-win') + autoUpdater = require('./auto-updater/auto-updater-win') + default + # take the default binding for the current platform + autoUpdater = process.atomBinding('auto_updater').autoUpdater EventEmitter = require('events').EventEmitter diff --git a/atom/browser/api/lib/auto-updater/auto-updater-win.coffee b/atom/browser/api/lib/auto-updater/auto-updater-win.coffee index 043d4c7c419f..556b86cbc95e 100644 --- a/atom/browser/api/lib/auto-updater/auto-updater-win.coffee +++ b/atom/browser/api/lib/auto-updater/auto-updater-win.coffee @@ -7,7 +7,10 @@ class AutoUpdater quitAndInstall: -> # TODO - setFeedUrl: (@updateUrl) -> + setFeedUrl: (updateUrl) -> + # set feed URL only when it hasn't been set before + unless @updateUrl + @updateUrl = updateUrl checkForUpdates: -> throw new Error('Update URL is not set') unless @updateUrl diff --git a/atom/browser/api/lib/auto-updater/squirrel-update-win.coffee b/atom/browser/api/lib/auto-updater/squirrel-update-win.coffee index faaa907f679f..d57a0130784e 100644 --- a/atom/browser/api/lib/auto-updater/squirrel-update-win.coffee +++ b/atom/browser/api/lib/auto-updater/squirrel-update-win.coffee @@ -2,8 +2,8 @@ ChildProcess = require 'child_process' fs = require 'fs' path = require 'path' -appFolder = path.resolve(process.execPath, '..') # i.e. my-app/app-0.1.13/ -rootApplicationFolder = path.resolve(appFolder, '..') # i.e. my-app/ +appFolder = path.dirname(process.execPath) # i.e. my-app/app-0.1.13/ +rootApplicationFolder = path.resolve(appFolder, '..') # i.e. my-app/ updateDotExe = path.join(rootApplicationFolder, 'Update.exe') exeName = path.basename(process.execPath)