Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

feat(desktop): enforce a single application instance

izumkie8fbe279e2a4
diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md
index a5b52e2c..94b6258b 100644
--- a/docs/DEVELOPMENT.md
+++ b/docs/DEVELOPMENT.md
@@ -7,7 +7,7 @@ DeepSeek Harness Desktop is a **Tauri 2 + React 18** app: the UI lives in `src/`
| Tool | Version |
| --- | --- |
| Node.js | 20+ |
-| Rust | 1.77+ |
+| Rust | 1.77.2+ |
| pnpm | 9+ |
Plus the platform toolchain:
diff --git a/docs/DEVELOPMENT.zh.md b/docs/DEVELOPMENT.zh.md
index d6dcae4b..2f0121df 100644
--- a/docs/DEVELOPMENT.zh.md
+++ b/docs/DEVELOPMENT.zh.md
@@ -7,7 +7,7 @@ DeepSeek Harness Desktop 是 **Tauri 2 + React 18** 应用:前端位于 `src/`
| 工具 | 版本 |
| --- | --- |
| Node.js | 20+ |
-| Rust | 1.77+ |
+| Rust | 1.77.2+ |
| pnpm | 9+ |
以及平台编译工具链:
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index a64d9bfe..f16da76c 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -832,6 +832,7 @@ dependencies = [
"tauri-plugin-fs",
"tauri-plugin-notification",
"tauri-plugin-opener",
+ "tauri-plugin-single-instance",
"tauri-plugin-store",
"tokio",
"webview2-com",
@@ -4390,6 +4391,22 @@ dependencies = [
"zbus",
]
+[[package]]
+name = "tauri-plugin-single-instance"
+version = "2.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b3214becf9ef5783c0ae99a3bb25adf5353a7a16ebf53e74b909e29205735c6c"
+dependencies = [
+ "serde",
+ "serde_json",
+ "tauri",
+ "thiserror 2.0.20",
+ "tokio",
+ "tracing",
+ "windows-sys 0.60.2",
+ "zbus",
+]
+
[[package]]
name = "tauri-plugin-store"
version = "2.4.4"
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 0808d07b..c556910a 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -25,6 +25,7 @@ tauri = { version = "2", features = [
"image-png",
"devtools"
] }
+tauri-plugin-single-instance = "2"
tauri-plugin-opener = "2"
tauri-plugin-fs = "2"
tauri-plugin-store = "2"
diff --git a/src-tauri/src/desktop/builder.rs b/src-tauri/src/desktop/builder.rs
index 50500a2e..1947a013 100644
--- a/src-tauri/src/desktop/builder.rs
+++ b/src-tauri/src/desktop/builder.rs
@@ -207,6 +207,10 @@ pub fn handler() -> impl Fn(Invoke<Wry>) -> bool + Send + Sync + 'static {
// configure tauri builder
pub fn builder() -> tauri::Builder<tauri::Wry> {
tauri::Builder::default()
+ // 单实例插件必须最先注册:重复启动时仅唤醒当前主窗口。
+ .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
+ show_main_window(app);
+ }))
.setup(|app| {
let app_handle = app.handle().clone();
build_main_window(&app_handle)?;