Skip to content

Commit e294bc3

Browse files
committed
fix(electron-forge): add app icon configuration for all platforms
1 parent 9300bef commit e294bc3

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

electron/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,15 @@ const createMainWindow = () => {
418418
};
419419

420420
app.whenReady().then(() => {
421+
// Set app name and dock icon for development mode on macOS
422+
if (process.platform === 'darwin') {
423+
app.setName('seedit');
424+
if (app.dock) {
425+
const iconPath = path.join(dirname, '..', isDev ? 'public' : 'build', 'icon.png');
426+
app.dock.setIcon(iconPath);
427+
}
428+
}
429+
421430
createMainWindow();
422431

423432
app.on('activate', () => {

forge.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const config = {
55
name: 'seedit',
66
executableName: 'seedit',
77
appBundleId: 'seedit.desktop',
8+
icon: './public/icon', // electron-forge adds the correct extension per platform
89

910
// NOTE: asar is disabled because of a bug where electron-packager silently fails
1011
// during asar creation with seedit's large node_modules. The app works fine without it.
@@ -67,6 +68,7 @@ const config = {
6768
platforms: ['darwin'],
6869
config: {
6970
name: 'seedit',
71+
icon: './public/icon.png',
7072
format: 'UDZO',
7173
},
7274
},
@@ -80,6 +82,8 @@ const config = {
8082
platforms: ['win32'],
8183
config: {
8284
name: 'seedit',
85+
setupIcon: './public/favicon.ico',
86+
iconUrl: 'file://public/favicon.ico',
8387
},
8488
},
8589
// Linux
@@ -88,6 +92,8 @@ const config = {
8892
platforms: ['linux'],
8993
config: {
9094
options: {
95+
name: 'seedit',
96+
icon: './public/icon.png',
9197
categories: ['Network'],
9298
},
9399
},

0 commit comments

Comments
 (0)