fix: Windows 汉化版检测修复(.cmd shim 路径不含包名,需检查文件系统)

detect_installed_source Windows 分支:classify_cli_source 返回 npm-official 时不再直接返回 official,
而是继续检查 @qingchencloud/openclaw-zh 目录是否存在。修复汉化版被误判为官方原版的问题。
This commit is contained in:
晴天
2026-03-26 06:24:48 +08:00
parent c7cc6fd9a4
commit 535f72d1f9

View File

@@ -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() {