From 3f8971aa559bdb7066da5685ee12ec384dd27fd8 Mon Sep 17 00:00:00 2001 From: liangxu Date: Fri, 8 May 2026 23:15:08 +0800 Subject: [PATCH] chore(desktop): brand dev-time app name as ShengxinPush MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setName pins the runtime app name (menu bar, task switcher) and setAboutPanelOptions overrides the macOS About panel which is sourced separately from Info.plist when running unpackaged. Packaged builds are unaffected: electron-builder productName "省心推" still drives the .app bundle and NSIS installer metadata. The macOS Dock label in dev still shows "Electron" because that comes from the unpacked Electron.app bundle's CFBundleName, which is outside Electron's API surface. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/desktop-client/src/main/bootstrap.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/desktop-client/src/main/bootstrap.ts b/apps/desktop-client/src/main/bootstrap.ts index 92769e5..35b4d4f 100644 --- a/apps/desktop-client/src/main/bootstrap.ts +++ b/apps/desktop-client/src/main/bootstrap.ts @@ -63,6 +63,24 @@ import { initTray, showTrayBalloon } from './tray' import { STANDARD_USER_AGENT } from './user-agent' import { startHotViewReaper } from './view-pool' +// In dev (no packaged Info.plist / NSIS metadata) Electron falls back to the +// generic "Electron" name, so the macOS menu bar and Windows task switcher +// show "Electron". Pin the dev-time app name to the product brand. Packaged +// builds ignore this because Info.plist `CFBundleName` (driven by +// electron-builder `productName`) takes precedence. +app.setName('ShengxinPush') + +// The macOS "About" panel pulls from a separate options bag — `setName` alone +// leaves it as "Electron 41.x". Set explicit copy here so the dev About dialog +// matches the brand. Packaged macOS again wins via Info.plist. +app.setAboutPanelOptions({ + applicationName: 'ShengxinPush', + applicationVersion: app.getVersion(), + version: app.getVersion(), + copyright: 'Copyright © 2026 shengxintui.com', + website: 'https://shengxintui.com', +}) + app.commandLine.appendSwitch( 'disable-features', 'PostQuantumKyber,EncryptedClientHello,UseDnsHttpsSvcb,UseDnsHttpsSvcbAlpn',