0.1.11 重新打包:修复「定位」在含空格路径上跳错文件夹

- reveal_path 给 explorer.exe 的 /select 参数改用 raw_arg 原样传参:此前 Rust 会把整个 /select,<path> 参数包成一对引号,explorer 解析失败后打开默认目录(实测 Package Cache 路径跳到了 D:\Documents);explorer 要求引号只包住路径部分(/select,"C:\…"),修正后经 Shell COM 实测正确打开目标文件夹并选中文件
- 不含空格的路径(如 C:\hiberfil.sys)此前行为本来就正确,本次只修空格路径
- 便携包与安装 exe 同步重建,release/0.1.11 全套产物刷新(安装包/便携包/SHA256/更新清单)
dev
lijunjie 2026-11-24 15:46:25 +08:00
parent e802f7a231
commit 79b2e1df49
5 changed files with 16 additions and 8 deletions

View File

@ -1,2 +1,2 @@
e848c8ed53e9d599dee2e12d10cd5d380baaf6de6498fe33968fff105e3eedee Squid-Setup-0.1.11-win-x64.exe
e5edf6c6f26a1e5f62ea63147dd357425fb6dc5be24688e1230d329bee26bb4c Squid-0.1.11-portable-win-x64.zip
196d6382bded50d5d8dd0593240b016adf8c9cb5e2f95e610d8d1bf029a158be Squid-Setup-0.1.11-win-x64.exe
4349e178016a8596ce56c2ed0ab31013cfa7eefe13b0aac68b9eca8a7f022be5 Squid-0.1.11-portable-win-x64.zip

View File

@ -6,8 +6,8 @@
"artifacts": {
"windows": {
"file": "Squid-Setup-0.1.11-win-x64.exe",
"sha256": "e848c8ed53e9d599dee2e12d10cd5d380baaf6de6498fe33968fff105e3eedee",
"size": 3851440
"sha256": "196d6382bded50d5d8dd0593240b016adf8c9cb5e2f95e610d8d1bf029a158be",
"size": 3850501
}
}
}

View File

@ -1588,10 +1588,18 @@ pub fn reveal_path(app: AppHandle, path: String) -> Result<(), String> {
}
#[cfg(windows)]
{
crate::process::command("explorer.exe")
.arg(format!("/select,{}", target.display()))
.status()
.map_err(|error| error.to_string())?;
use std::os::windows::process::CommandExt;
// Explorer only understands `/select,"C:\path with space\x"` — the
// quotes must sit *inside* the argument, around the path. Handing
// the whole `/select,<path>` as one argument let Rust wrap it in
// one pair of quotes, Explorer failed to parse it and opened its
// default folder instead (定位 jumped to the wrong directory as
// soon as the path contained a space, e.g. Package Cache).
// `raw_arg` writes the argument verbatim, producing the exact
// command line Explorer documents.
let mut cmd = crate::process::command("explorer.exe");
cmd.raw_arg(format!("/select,\"{}\"", target.display()));
cmd.status().map_err(|error| error.to_string())?;
}
#[cfg(not(any(target_os = "macos", windows)))]
{