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
+12
View File
@@ -12,6 +12,7 @@ void test('package.json: конфиг electron-builder (mac/win)', () => {
appId: string;
asar: boolean;
asarUnpack: string[];
extraResources: { from: string; to: string }[];
mac: { target: unknown };
files: string[];
};
@@ -21,6 +22,17 @@ void test('package.json: конфиг electron-builder (mac/win)', () => {
assert.equal(pkg.build.asar, true, 'релизный артефакт: app.asar без «голого» дерева dist в .app/.exe');
assert.ok(Array.isArray(pkg.build.asarUnpack));
assert.ok(pkg.build.asarUnpack.some((p) => p.includes('preload')));
assert.ok(Array.isArray(pkg.build.extraResources));
assert.ok(
pkg.build.extraResources.some(
(e: unknown) =>
typeof e === 'object' &&
e !== null &&
'to' in e &&
typeof (e as { to: unknown }).to === 'string' &&
(e as { to: string }).to.includes('branding'),
),
);
assert.ok(Array.isArray(pkg.build.mac.target));
assert.ok(pkg.build.files.includes('dist/**/*'));
});