Merge branch 'master' into linux
This commit is contained in:
commit
d89fb15daf
12 changed files with 49 additions and 13 deletions
|
@ -80,7 +80,9 @@ void AutoUpdater::CheckForUpdates(
|
|||
void AutoUpdater::QuitAndInstall(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
AutoUpdater* self = AutoUpdater::Unwrap<AutoUpdater>(args.This());
|
||||
self->quit_and_install_.Run();
|
||||
|
||||
if (!self->quit_and_install_.is_null())
|
||||
self->quit_and_install_.Run();
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -8,4 +8,18 @@ autoUpdater.on 'update-downloaded-raw', (args...) ->
|
|||
args[3] = new Date(args[3]) # releaseDate
|
||||
@emit 'update-downloaded', args..., => @quitAndInstall()
|
||||
|
||||
autoUpdater.quitAndInstall = ->
|
||||
# If we don't have any window then quitAndInstall immediately.
|
||||
BrowserWindow = require 'browser-window'
|
||||
windows = BrowserWindow.getAllWindows()
|
||||
if windows.length is 0
|
||||
AutoUpdater::quitAndInstall.call this
|
||||
return
|
||||
|
||||
# Do the restart after all windows have been closed.
|
||||
app = require 'app'
|
||||
app.removeAllListeners 'window-all-closed'
|
||||
app.once 'window-all-closed', AutoUpdater::quitAndInstall.bind(this)
|
||||
win.close() for win in windows
|
||||
|
||||
module.exports = autoUpdater
|
||||
|
|
|
@ -5,6 +5,7 @@ sendWrap = (channel, processId, routingId, args...) ->
|
|||
BrowserWindow = require 'browser-window'
|
||||
if processId?.constructor is BrowserWindow
|
||||
window = processId
|
||||
args = [routingId, args...]
|
||||
processId = window.getProcessId()
|
||||
routingId = window.getRoutingId()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue