DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
fix: use bundled PNG for Windows notification identity icon (#798)
Mao Mr65a60ecf11d8
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.jsonindex 7f66c0b1..a5285ebc 100644--- a/src-tauri/tauri.conf.json+++ b/src-tauri/tauri.conf.json@@ -24,7 +24,8 @@},"notifications": {"windows": {- "toastActivatorClsid": "4FBB68DF-E119-4FBB-82D5-FA10F85B519B"+ "toastActivatorClsid": "4FBB68DF-E119-4FBB-82D5-FA10F85B519B",+ "iconPath": "icons/32x32.png"}}},@@ -39,7 +40,7 @@"icons/icon.ico","icons/icon.png"],- "resources": ["resources/**/*"],+ "resources": ["resources/**/*", "icons/32x32.png"],"licenseFile": "licenses/INSTALLER-LICENSE.txt","category": "DeveloperTool","copyright": "Copyright © 2026 Deepseek Harness Desktop contributors",diff --git a/src-tauri/vendor/tauri-plugin-notifications/PATCH.md b/src-tauri/vendor/tauri-plugin-notifications/PATCH.mdindex cb1f1317..2e4b8e8c 100644--- a/src-tauri/vendor/tauri-plugin-notifications/PATCH.md+++ b/src-tauri/vendor/tauri-plugin-notifications/PATCH.md@@ -75,8 +75,11 @@ twice.- `register_unpackaged_app_id()` — writes `HKCU\Software\Classes\AppUserModelId\<app_id>`(`DisplayName`, `IconUri`, `CustomActivator={CLSID}`) and`HKCU\Software\Classes\CLSID\{CLSID}\LocalServer32` = the current executable, which is the- AUMID mapping an unpackaged build needs. Best-effort: failures are logged and the- in-process path still works while the app is running.+ AUMID mapping an unpackaged build needs. `IconUri` uses the resolved PNG resource+ configured by `plugins.notifications.windows.iconPath`; Windows does not extract+ the toast header icon from an EXE. The resource is explicitly included in+ `bundle.resources`. Best-effort: failures are logged and the in-process path+ still works while the app is running.- `spawn_toast_activator()` — register `ToastActivatorFactory` on a dedicatedsingle-threaded-apartment thread that then blocks in `GetMessageW` /`TranslateMessage` / `DispatchMessageW` for the life of the process, and is registereddiff --git a/src-tauri/vendor/tauri-plugin-notifications/src/lib.rs b/src-tauri/vendor/tauri-plugin-notifications/src/lib.rsindex ec7807da..febe8c7b 100644--- a/src-tauri/vendor/tauri-plugin-notifications/src/lib.rs+++ b/src-tauri/vendor/tauri-plugin-notifications/src/lib.rs@@ -35,6 +35,7 @@ pub struct WindowsConfig {/// and `<com:Class Id>` entries. Accepts the `xxxxxxxx-xxxx-...` form/// with or without surrounding braces.pub toast_activator_clsid: Option<String>,+ pub icon_path: Option<std::path::PathBuf>,}pub use models::*;diff --git a/src-tauri/vendor/tauri-plugin-notifications/src/windows.rs b/src-tauri/vendor/tauri-plugin-notifications/src/windows.rsindex dcd6d139..2103281b 100644--- a/src-tauri/vendor/tauri-plugin-notifications/src/windows.rs+++ b/src-tauri/vendor/tauri-plugin-notifications/src/windows.rs@@ -631,7 +631,21 @@ pub fn init<R: Runtime, C: DeserializeOwned>(.product_name.clone().unwrap_or_else(|| plugin.app_id.clone());- if let Err(e) = register_unpackaged_app_id(&display_name, &plugin.app_id, clsid_str) {+ let icon_path = windows_config.icon_path.as_ref().and_then(|path| {+ match app.path().resolve(path, BaseDirectory::Resource) {+ Ok(resolved) if resolved.is_file() => Some(resolved),+ result => {+ log::warn!("Cannot resolve notification icon {path:?}: {result:?}");+ None+ }+ }+ });+ if let Err(e) = register_unpackaged_app_id(+ &display_name,+ &plugin.app_id,+ clsid_str,+ icon_path.as_deref(),+ ) {log::error!("Failed to register AUMID {} for toast activation: {e}; \Action Center clicks will fall back to shortcut launch without payload",@@ -691,6 +705,7 @@ fn register_unpackaged_app_id(display_name: &str,app_id: &str,clsid_str: &str,+ icon_path: Option<&std::path::Path>,) -> windows::core::Result<()> {let exe = std::env::current_exe().map_err(|e| {windows::core::Error::new(E_FAIL, format!("cannot resolve current executable: {e}"))@@ -717,7 +732,10 @@ fn register_unpackaged_app_id(return Err(status.into());}let result = write_registry_string(aumid_key, Some("DisplayName"), display_name)- .and_then(|()| write_registry_string(aumid_key, Some("IconUri"), &exe))+ .and_then(|()| match icon_path {+ Some(path) => write_registry_string(aumid_key, Some("IconUri"), &path.to_string_lossy()),+ None => Ok(()),+ }).and_then(|()| {write_registry_string(aumid_key,diff --git a/test/notification-icon.test.ts b/test/notification-icon.test.tsnew file mode 100644index 00000000..d891bdb9--- /dev/null+++ b/test/notification-icon.test.ts@@ -0,0 +1,17 @@+import { readFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import { describe, expect, it } from 'vitest'++const tauriRoot = new URL('../src-tauri/', import.meta.url)+const config = JSON.parse(readFileSync(new URL('tauri.conf.json', tauriRoot), 'utf8'))++describe('windows notification app identity icon', () => {+ it('configures a bundled PNG rather than an executable icon resource', () => {+ expect(config.plugins.notifications.windows.iconPath).toBe('icons/32x32.png')+ expect(config.bundle.resources).toContain('icons/32x32.png')+ const icon = readFileSync(fileURLToPath(new URL('icons/32x32.png', tauriRoot)))+ expect([...icon.subarray(0, 8)]).toEqual([137, 80, 78, 71, 13, 10, 26, 10])+ expect(icon.readUInt32BE(16)).toBe(32)+ expect(icon.readUInt32BE(20)).toBe(32)+ })+})