Skip to content

Commit e7e736a

Browse files
committed
Handle squirrel events so we do windows installs properly
1 parent 3aa94f4 commit e7e736a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ const createWindow = async () => {
3333
});
3434
};
3535

36-
app.on('ready', createWindow);
37-
3836
app.on('window-all-closed', () => {
3937
// On OS X it is common for applications and their menu bar
4038
// to stay active until the user quits explicitly with Cmd + Q
@@ -80,4 +78,12 @@ app.on('web-contents-created', (_event, contents) => {
8078
shell.openExternal(navigationUrl);
8179
}
8280
});
83-
});
81+
});
82+
83+
if (require('electron-squirrel-startup')) {
84+
// We've been opened as part of a Windows install.
85+
// squirrel-startup handles all the hard work, we just need to not do anything.
86+
app.quit();
87+
} else {
88+
app.on('ready', createWindow);
89+
}

0 commit comments

Comments
 (0)