Skip to content

Commit

Permalink
Handle squirrel events so we do windows installs properly
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Nov 27, 2018
1 parent 3aa94f4 commit e7e736a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const createWindow = async () => {
});
};

app.on('ready', createWindow);

app.on('window-all-closed', () => {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
Expand Down Expand Up @@ -80,4 +78,12 @@ app.on('web-contents-created', (_event, contents) => {
shell.openExternal(navigationUrl);
}
});
});
});

if (require('electron-squirrel-startup')) {
// We've been opened as part of a Windows install.
// squirrel-startup handles all the hard work, we just need to not do anything.
app.quit();
} else {
app.on('ready', createWindow);
}

0 comments on commit e7e736a

Please sign in to comment.