Skip to content

Instantly share code, notes, and snippets.

@ckerr
Created January 13, 2021 17:21
Show Gist options
  • Save ckerr/d43fad3e4419b796a08c39ec394ad94a to your computer and use it in GitHub Desktop.
Save ckerr/d43fad3e4419b796a08c39ec394ad94a to your computer and use it in GitHub Desktop.
const { app, BrowserWindow } = require('electron')
function createWindow () {
const win = new BrowserWindow({
icon: undefined // "/Applications/Visual Studio Code.app/Contents/Resources/Code.icns", // <-- comment to avoid crash, or use electron 11.1.1
/**
* Jan 13 13:44:22 Electron Helper[26232] <Error>: read failed
Jan 13 13:44:22 Electron Helper[26232] <Error>: SeatbeltExecServer: failed to read buffer length.
Failed to initialize sandbox.
/Users/idanwork/Projects/electron-icon/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGSEGV
*/
// icon: `${__dirname}/Code.icns`, // Tried to copy the icon locally, didn't help
})
win.loadURL('https://www.electronjs.org/docs/api/browser-window');
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => app.quit())
app.on('activate', () => BrowserWindow.getAllWindows().length === 0 && createWindow());
{
"name": "electron-icon",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"run": "electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"scripts": {
"start": "electron main.js"
},
"devDependencies": {
"electron": "11.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment