fix(win): restore tray/taskbar and installer icons; release 1.0.5
Release / release (push) Successful in 5m8s
Release / release (push) Successful in 5m8s
- Generate build/icon.ico for electron-builder (exe/NSIS/Programs list). - Unpack branding PNGs from asar so nativeImage loads on Windows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -70,18 +70,27 @@ function getPreloadPath(): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* PNG для иконки окна / дока: тот же растр, что electron-builder берёт из `build/icon.png`
|
||||
* (копия в dist после сборки), затем окно 256px, затем dev-пути. SVG не используем для
|
||||
* nativeImage на Windows — иначе пустая картинка и дефолтная иконка Electron вместо exe.
|
||||
* PNG для иконки окна / дока: копия `build/icon.png` в dist после сборки, затем окно 256px.
|
||||
* В упакованном приложении файлы под `dist/renderer/*.png` вынесены в `app.asar.unpacked`
|
||||
* — `nativeImage` на Windows с путём только внутри asar часто даёт пустую иконку.
|
||||
* SVG не используем для nativeImage на Windows — иначе пустая картинка и дефолт Electron.
|
||||
*/
|
||||
function resolveBrandingPngPaths(): string[] {
|
||||
const root = app.getAppPath();
|
||||
return [
|
||||
path.join(root, 'dist', 'renderer', 'app-pack-icon.png'),
|
||||
path.join(root, 'dist', 'renderer', 'app-window-icon.png'),
|
||||
const relPack = path.join('dist', 'renderer', 'app-pack-icon.png');
|
||||
const relWindow = path.join('dist', 'renderer', 'app-window-icon.png');
|
||||
const paths: string[] = [];
|
||||
if (app.isPackaged) {
|
||||
const unpacked = path.join(process.resourcesPath, 'app.asar.unpacked');
|
||||
paths.push(path.join(unpacked, relPack), path.join(unpacked, relWindow));
|
||||
}
|
||||
paths.push(
|
||||
path.join(root, relPack),
|
||||
path.join(root, relWindow),
|
||||
path.join(root, 'build', 'icon.png'),
|
||||
path.join(root, 'app', 'renderer', 'public', 'app-window-icon.png'),
|
||||
];
|
||||
);
|
||||
return paths;
|
||||
}
|
||||
|
||||
function resolveWindowIconPath(): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user