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; // 是否使用默认托盘图标