Skip to content

Commit

Permalink
fix(windows): Fix Windows crashes at startup. Improve installer.
Browse files Browse the repository at this point in the history
Recently added menu item functionality broken Windows at startup. Add some options to the installer so that it behaves more like a normal application installer.
  • Loading branch information
dustmop committed Sep 3, 2019
1 parent 93e81df commit 3cbfd54
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
22 changes: 14 additions & 8 deletions app/main.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ if (process.env.NODE_ENV === 'development') {
require('module').globalPaths.push(p); // eslint-disable-line
}

app.setAboutPanelOptions({
applicationName: 'Qri Desktop',
applicationVersion: '0.0.1',
credits: 'https://qri.io',
website: 'https://qri.io',
iconPath: '../assets/qri-blob-logo-large.png'
})
if (app.setAboutPanelOptions) {
// Mac only
app.setAboutPanelOptions({
applicationName: 'Qri Desktop',
applicationVersion: '0.0.1',
credits: 'https://qri.io',
website: 'https://qri.io',
iconPath: '../assets/qri-blob-logo-large.png'
})
}

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
Expand All @@ -52,7 +55,10 @@ const setMenuItemEnabled = (menuItemIds, enabled) => {
const menu = Menu.getApplicationMenu()

menuItemIds.forEach(menuItemId => {
menu.getMenuItemById(menuItemId).enabled = enabled
let item = menu.getMenuItemById(menuItemId)
if (item) {
item.enabled = enabled
}
})
}

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
"win": {
"target": "nsis"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,
"runAfterFinish": false
},
"linux": {
"target": [
"deb",
Expand Down

0 comments on commit 3cbfd54

Please sign in to comment.