icon for the system tray wasn't being found correctly for packaged releases

This commit is contained in:
Egor 2025-10-01 12:32:38 -07:00
parent de67b36629
commit 3d62d9d00c
2 changed files with 11 additions and 8 deletions

View file

@ -1,7 +1,7 @@
{
"name": "gerbil",
"productName": "Gerbil",
"version": "1.6.2",
"version": "1.6.3",
"description": "Run Large Language Models locally",
"main": "out/main/index.js",
"homepage": "./",
@ -109,6 +109,12 @@
"to": "assets/kcpp_sdui.embd"
}
],
"extraResources": [
{
"from": "src/assets/icon.png",
"to": "icon.png"
}
],
"mac": {
"compression": "maximum",
"category": "public.app-category.productivity",

View file

@ -6,7 +6,7 @@ import {
MenuItemConstructorOptions,
} from 'electron';
import { join } from 'path';
import { resourcesPath, platform } from 'process';
import { platform, resourcesPath } from 'process';
import { getEnableSystemTray } from './config';
import { getMainWindow } from './window';
import type { CpuMetrics, MemoryMetrics, GpuMetrics } from './monitoring';
@ -184,12 +184,9 @@ export function createTray() {
return;
}
let iconPath: string;
if (app.isPackaged) {
iconPath = join(resourcesPath, 'assets', 'icon.png');
} else {
iconPath = join(__dirname, '../../src/assets/icon.png');
}
const iconPath = app.isPackaged
? join(resourcesPath, 'icon.png')
: join(__dirname, '../../src/assets/icon.png');
const icon = nativeImage.createFromPath(iconPath);