From 535f72d1f9eebc3c6e3500d3c02affd6078ec51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E5=A4=A9?= Date: Thu, 26 Mar 2026 06:24:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Windows=20=E6=B1=89=E5=8C=96=E7=89=88?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E4=BF=AE=E5=A4=8D=EF=BC=88.cmd=20shim=20?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=B8=8D=E5=90=AB=E5=8C=85=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E6=A3=80=E6=9F=A5=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit detect_installed_source Windows 分支:classify_cli_source 返回 npm-official 时不再直接返回 official, 而是继续检查 @qingchencloud/openclaw-zh 目录是否存在。修复汉化版被误判为官方原版的问题。 --- src-tauri/src/commands/config.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/commands/config.rs b/src-tauri/src/commands/config.rs index 64d7186..cf0168c 100644 --- a/src-tauri/src/commands/config.rs +++ b/src-tauri/src/commands/config.rs @@ -1337,15 +1337,16 @@ fn detect_installed_source() -> String { // Windows: 优先通过 CLI 路径判断,fallback 到文件系统检测 #[cfg(target_os = "windows")] { - // 优先通过实际 CLI 路径判断(最准确) + // 优先通过实际 CLI 路径判断 if let Some(cli_path) = crate::utils::resolve_openclaw_cli_path() { let source = crate::utils::classify_cli_source(&cli_path); if source == "npm-zh" { return "chinese".into(); } - if source == "npm-official" || source == "npm-global" || source == "standalone" { + if source == "standalone" { return "official".into(); } + // npm-official/npm-global: Windows .cmd shim 路径不含包名,需继续检查文件系统 } // 检查所有可能的 standalone 安装目录 for sa_dir in all_standalone_dirs() {