diff --git a/src/app/atom.coffee b/src/app/atom.coffee index d8b2adfff..dd913b7ed 100644 --- a/src/app/atom.coffee +++ b/src/app/atom.coffee @@ -244,7 +244,7 @@ window.atom = windowState update: -> - throw new Error('atom.update is not implemented') + ipc.sendChannel 'install-update' getUpdateStatus: (callback) -> throw new Error('atom.getUpdateStatus is not implemented') diff --git a/src/atom-application.coffee b/src/atom-application.coffee index 4cc3c69b7..af8ce641b 100644 --- a/src/atom-application.coffee +++ b/src/atom-application.coffee @@ -35,6 +35,7 @@ class AtomApplication configWindow: null menu: null resourcePath: null + installUpdate: null version: null constructor: ({@resourcePath, pathsToOpen, @version, test, pidToKillWhenClosed, @dev}) -> @@ -187,6 +188,7 @@ class AtomApplication autoUpdater.on 'ready-for-update-on-quit', (event, version, quitAndUpdate) => event.preventDefault() + @installUpdate = quitAndUpdate @buildApplicationMenu version, quitAndUpdate ipc.on 'close-without-confirm', (processId, routingId) -> @@ -206,6 +208,9 @@ class AtomApplication ipc.on 'new-window', => @open() + ipc.on 'install-update', => + @installUpdate?() + ipc.on 'get-version', (event) => event.result = @version