From e2ca05393cdbebcb03f2cd9ce8d0ec6ada62704f Mon Sep 17 00:00:00 2001 From: ygkn <2000ygkn0713@gmail.com> Date: Sat, 22 Oct 2022 13:56:18 +0900 Subject: [PATCH] set up build --- desktop/electron/main/menu/tray.ts | 6 ++++-- desktop/package.json | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) 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": {