fix(win): load window icon from ICO on disk + buffer PNG (1.0.6)
Release / release (push) Successful in 5m8s

nativeImage from paths inside app.asar often yields empty images on Windows.
Ship icon.ico via extraResources and read with createFromBuffer; setIcon on boot + app windows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-05-12 08:24:14 +08:00
parent 1840227be6
commit 2037144a5c
6 changed files with 166 additions and 91 deletions
+11
View File
@@ -4,6 +4,8 @@ import { app, BrowserWindow } from 'electron';
import { getAppSemanticVersion } from '../versionInfo';
import { loadBrandingWindowIcon } from './brandingIcon';
let bootSplashRef: BrowserWindow | null = null;
export function getBootSplashWindow(): BrowserWindow | null {
@@ -37,6 +39,7 @@ function bootWebPreferences(): Electron.WebPreferences {
* Показывать после `waitForBootWindowReady`.
*/
export function createBootWindow(): BrowserWindow {
const icon = loadBrandingWindowIcon();
const win = new BrowserWindow({
width: 440,
height: 420,
@@ -50,8 +53,16 @@ export function createBootWindow(): BrowserWindow {
transparent: false,
backgroundColor: '#09090B',
roundedCorners: true,
...(icon ? { icon } : {}),
webPreferences: bootWebPreferences(),
});
if (icon) {
try {
win.setIcon(icon);
} catch {
/* ignore */
}
}
bootSplashRef = win;
win.once('closed', () => {