diff --git a/menus/win32.cson b/menus/win32.cson index 3ce871942..e670d8c22 100644 --- a/menus/win32.cson +++ b/menus/win32.cson @@ -164,6 +164,9 @@ { label: 'View &Terms of Use', command: 'application:open-terms-of-use' } { label: 'View &License', command: 'application:open-license' } { label: 'VERSION', enabled: false } + { label: 'Restart and Install Update', command: 'application:install-update', visible: false} + { label: 'Check for Update', command: 'application:check-for-update', visible: false} + { label: 'Downloading Update', enabled: false, visible: false} { type: 'separator' } { label: '&Documentation', command: 'application:open-documentation' } { label: 'Roadmap', command: 'application:open-roadmap' } diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index c9cd339ec..65b3ef14d 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -7,6 +7,7 @@ CheckingState = 'checking' DownladingState = 'downloading' UpdateAvailableState = 'update-available' NoUpdateAvailableState = 'no-update-available' +UnsupportedState = 'unsupported' ErrorState = 'error' module.exports = @@ -53,6 +54,12 @@ class AutoUpdateManager unless /\w{7}/.test(@version) @check(hidePopups: true) + switch process.platform + when 'win32' + @setState(UnsupportedState) unless autoUpdater.supportsUpdates() + when 'linux' + @setState(UnsupportedState) + 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 index 31af1a7aa..72e1d46ab 100644 --- a/src/browser/auto-updater-win32.coffee +++ b/src/browser/auto-updater-win32.coffee @@ -36,6 +36,9 @@ class AutoUpdater installUpdate: (callback) -> SquirrelUpdate.spawn(['--update', @updateUrl], callback) + supportsUpdates: -> + SquirrelUpdate.existsSync() + checkForUpdates: -> throw new Error('Update URL is not set') unless @updateUrl