From 48c2707a44dab1dce286e8d1f02a628bdac70abb Mon Sep 17 00:00:00 2001 From: Tlntin Date: Thu, 29 Dec 2022 11:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E7=9A=84=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=E5=80=99=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=B8=BA=E5=BE=AE=E4=BF=A1=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/builders/common.ts | 9 +++++++++ dist/cli.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/bin/builders/common.ts b/bin/builders/common.ts index c5985fa..5baebd1 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -218,6 +218,15 @@ export async function mergeTauriConfig( } } else { logger.warn("the custom icon path may not exists. we will use default icon to replace it"); + if (process.platform === "win32") { + tauriConf.tauri.bundle.icon = ["png/icon_256.ico"]; + } + if (process.platform === "linux") { + tauriConf.tauri.bundle.icon = ["png/icon_512.png"]; + } + if (process.platform === "darwin") { + tauriConf.tauri.bundle.icon = ["icons/icon.icns"]; + } } // 处理托盘自定义图标 diff --git a/dist/cli.js b/dist/cli.js index 41cd397..2754600 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1808,6 +1808,15 @@ function mergeTauriConfig(url, options, tauriConf) { } else { logger.warn("the custom icon path may not exists. we will use default icon to replace it"); + if (process.platform === "win32") { + tauriConf.tauri.bundle.icon = ["png/icon_256.ico"]; + } + if (process.platform === "linux") { + tauriConf.tauri.bundle.icon = ["png/icon_512.png"]; + } + if (process.platform === "darwin") { + tauriConf.tauri.bundle.icon = ["icons/icon.icns"]; + } } // 处理托盘自定义图标 let useDefaultIcon = true; // 是否使用默认托盘图标