diff --git a/desktop/electron/main/menu/tray.ts b/desktop/electron/main/menu/tray.ts index 4b7e97fe..22f71e6f 100644 --- a/desktop/electron/main/menu/tray.ts +++ b/desktop/electron/main/menu/tray.ts @@ -1,4 +1,4 @@ -import { Menu, Tray } from "electron"; +import { app, Menu, Tray } from "electron"; import { join } from "path"; import { publicPath } from "../path"; @@ -9,7 +9,9 @@ export const createTray = ({ appState, ...menuTemplateParam }: Parameters[0]) => { - const iconPath = join(publicPath, "assets/menu-bar-icon.png"); + const iconPath = app.isPackaged + ? join(process.resourcesPath!, "public", "assets", "menu-bar-icon.png") + : join(publicPath, "assets", "menu-bar-icon.png"); const tray = new Tray(iconPath); tray.setToolTip("スマートポインター"); diff --git a/desktop/package.json b/desktop/package.json index d30d8ede..994ad4cf 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -16,6 +16,9 @@ "check:type": "tsc" }, "build": { + "extraResources": [ + "public/assets/**/*" + ], "productName": "smartpointer", "appId": "dev.abelab.smartpointer", "mac": {