Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Set Windows taskbar icons explicitly

Daniel421caded46bb
diff --git a/app/electron/main.js b/app/electron/main.js
index a2a0c7f58a..081ca38457 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -731,7 +731,15 @@ app.setPath("userData", path.join(app.getPath("appData"), app.getName() + "-Elec
if (process.platform === "win32") {
// Windows 需要设置 AppUserModelId 才能正确显示应用名称和应用图标 https://github.com/siyuan-note/siyuan/issues/17022
- app.setAppUserModelId("org.b3log.siyuan");
+ const appUserModelId = "org.b3log.siyuan";
+ app.setAppUserModelId(appUserModelId);
+ // 为所有窗口指定任务栏图标,打包后使用可执行文件内嵌的图标资源。
+ app.on("browser-window-created", (event, window) => {
+ window.setAppDetails({
+ appId: appUserModelId,
+ appIconPath: app.isPackaged ? process.execPath : path.join(appDir, "src", "assets", "icon.ico"),
+ });
+ });
}
if (!app.requestSingleInstanceLock()) {