From 3d62d9d00ca04e8e550d074521bf7f7b108f9274 Mon Sep 17 00:00:00 2001 From: Egor Date: Wed, 1 Oct 2025 12:32:38 -0700 Subject: [PATCH] icon for the system tray wasn't being found correctly for packaged releases --- package.json | 8 +++++++- src/main/modules/tray.ts | 11 ++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index dcf4ba0..d7de71b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/main/modules/tray.ts b/src/main/modules/tray.ts index f334eac..88ea449 100644 --- a/src/main/modules/tray.ts +++ b/src/main/modules/tray.ts @@ -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);