Reputation: 83
I'm having trouble changing my electron app icon.
mainWindow = new BrowserWindow({
width: 1280,
height: 960,
frame: false,
icon: __dirname + 'img/joe.icns',
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true,
// worldSafeExecuteJavaScript: true,
// contextIsolation: true,
},
I've referenced stackoverflow and medium.com for my attempt.
I have also attemptted
icon: __dirname + 'src/img/joe.icns',
icon: __dirname + './img/joe.icns',
and other similar structure names.
Upvotes: 2
Views: 4184
Reputation: 83
Referencing stackoverflow, I assumed .icns (icon set) was the only extension allowed for electron apps. Reading Stackoverflow2 provided by @deniz, I've realized ico file type was also available and gave it a try, and it worked. I assumed icns was a complex icon file type, and my icns file was probably not compatible with electron app. Thank you (and sorry) for the effort @Majed Badawi.
icon: __dirname + '/img/joe.ico',
Upvotes: 1
Reputation: 28434
Try this:
icon: path.join(__static, 'joe.icns'),
And put the icon in ./dist_electron/bundled
and ./public
Upvotes: 3