From e294bc3c8bbbc8f37373fb46ba680fd858647365 Mon Sep 17 00:00:00 2001 From: plebeius Date: Fri, 30 Jan 2026 13:46:23 +0800 Subject: [PATCH] fix(electron-forge): add app icon configuration for all platforms --- electron/main.js | 9 +++++++++ forge.config.js | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/electron/main.js b/electron/main.js index a6330fe4..6bfd83a1 100644 --- a/electron/main.js +++ b/electron/main.js @@ -418,6 +418,15 @@ const createMainWindow = () => { }; app.whenReady().then(() => { + // Set app name and dock icon for development mode on macOS + if (process.platform === 'darwin') { + app.setName('seedit'); + if (app.dock) { + const iconPath = path.join(dirname, '..', isDev ? 'public' : 'build', 'icon.png'); + app.dock.setIcon(iconPath); + } + } + createMainWindow(); app.on('activate', () => { diff --git a/forge.config.js b/forge.config.js index 51191ec1..74d87e2e 100644 --- a/forge.config.js +++ b/forge.config.js @@ -5,6 +5,7 @@ const config = { name: 'seedit', executableName: 'seedit', appBundleId: 'seedit.desktop', + icon: './public/icon', // electron-forge adds the correct extension per platform // NOTE: asar is disabled because of a bug where electron-packager silently fails // during asar creation with seedit's large node_modules. The app works fine without it. @@ -67,6 +68,7 @@ const config = { platforms: ['darwin'], config: { name: 'seedit', + icon: './public/icon.png', format: 'UDZO', }, }, @@ -80,6 +82,8 @@ const config = { platforms: ['win32'], config: { name: 'seedit', + setupIcon: './public/favicon.ico', + iconUrl: 'file://public/favicon.ico', }, }, // Linux @@ -88,6 +92,8 @@ const config = { platforms: ['linux'], config: { options: { + name: 'seedit', + icon: './public/icon.png', categories: ['Network'], }, },