Skip to content

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

Merge remote-tracking branch 'upstream/main' into codex/update-readme-hero-banners

chenlong2f69b530fe5b
diff --cc src-tauri/src/service/workflow/mod.rs
index c167c99f,2460ecd2..a558b6b1
--- a/src-tauri/src/service/workflow/mod.rs
+++ b/src-tauri/src/service/workflow/mod.rs
@@@ -6,15 -6,14 +6,16 @@@ pub(crate) mod win_spawn
use crate::config;
use crate::service::download;
-use crate::service::workflow::utils::{is_dsh_running, is_port_in_use, spawn_output_readers};
+use crate::service::workflow::utils::{is_port_in_use, spawn_output_readers};
use std::collections::HashMap;
++
+#[cfg(windows)]
+use std::ffi::OsString;
use std::fs;
-use std::path::Path;
use std::process::{Command, Stdio};
#[cfg(windows)]
-use std::ffi::OsString;
-use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use tauri::Manager;
/// 启动守卫:并发调用 `launch` 时只允许一个真正拉起 dsh 进程
@@@ -364,13 -373,19 +365,14 @@@ pub async fn install
) -> Result<(), String> {
log::info!("Starting installation process");
- // 安装前先停止正在运行的 Harness 服务:运行中的 node 进程会把
+ // 安装前先停止本应用持有的 Harness 服务:运行中的 node 进程会把
// 原生模块 DLL(如 sharp 的 libvips-42.dll)加载进内存并锁住文件,
// 不停止的话覆盖解压必然失败(Windows os error 32)。
- // 注意不能只依赖 HTTP 探测:服务崩溃/失去响应时探测不到,但 node
- // 进程可能仍存活并持有 DLL,因此探测不到时也要强制清理。
- if is_dsh_running(config::get_store_dat_setting(app_handle).port).await {
+ // 进程归属以启动时记录的 PID 为准,不根据端口结束未知程序。
+ if has_owned_process() {
log::info!("Stopping running Harness service before installation");
stop(app_handle.clone()).await?;
- } else {
- log::warn!("Harness service not responding, force cleaning dsh processes");
- kill_port_holder(config::get_store_dat_setting(app_handle).port);
- kill_dsh_processes(&config::get_base_dir(app_handle));
- tokio::time::sleep(std::time::Duration::from_millis(800)).await;
++
}
let window = app_handle
@@@ -405,27 -417,13 +407,30 @@@
log::info!("Task {} not installed, starting installation", index + 1);
// 1. 下载
- tracker.start_phase("download", &format!("{} {}", config::i18n::t("install.downloading"), task.title()));
- let url = task.get_download_url()?;
+ tracker.start_phase(
+ "download",
+ &format!(
+ "{} {}",
+ config::i18n::t("install.downloading"),
+ task.title()
+ ),
+ );
+ let url = if index == 1 {
+ dsh_latest
+ .as_ref()
+ .map(|info| info.asset_url.clone())
+ .ok_or_else(|| {
+ "DSH_INTEGRITY_UNAVAILABLE: trusted release metadata is required for installation"
+ .to_string()
+ })?
+ } else {
+ task.get_download_url()?
+ };
log::debug!("Download URL: {}", url);
- let name = url.split('/').next_back().unwrap().to_string();
+ // 取文件名用于解压类型判定;下载 URL 正常必含 '/',但这里不 panic,
+ // 防御性兜底为空串(后续 ensure_extract 会因无法判定类型而报错返回,
+ // 不再让进程崩溃)。
+ let name = url.rsplit('/').next().unwrap_or("").to_string();
log::debug!("File name: {}", name);
let buffer = download::download_file(&tracker, url).await?;
log::info!("Download completed, file size: {} bytes", buffer.len());