启动项角色名不再自成一组:Windows File System Proxy 归入其他软件

- WinFsp 的 launcher-x64.exe 把 FileDescription 写成 "Windows File System
  Proxy"(看着像系统组件,实则 Navimatics 第三方库),命名优先级取了这句
  角色描述,导致启动列表冒出一个独立软件组
- 新规则 is_component_role_label:以 Windows/Microsoft 开头、以
  proxy/host/agent/service/helper/driver/launcher/broker 等角色词结尾的
  名字视为管道组件而非产品 → named=false,落入其他软件;真实产品名
  (微信、Windows Defender Firewall、WinFsp Launcher 等)不受影响
- 单测×2:角色词表边界断言 + 本机真机断言(WinFsp 行必须未归因;机器无
  WinFsp 自动跳过)
dev
lijunjie 2026-11-25 11:17:46 +08:00
parent a47b8922a5
commit 20abe3aef2
2 changed files with 81 additions and 4 deletions

View File

@ -606,6 +606,30 @@ mod windows {
(!product.is_empty()).then(|| product.to_string())
}
/// Windows-style *component role* descriptions shipped inside PEs —
/// "Windows File System Proxy" (WinFsp), "Microsoft Edge Elevation
/// Service" — label a role, not a product the user recognises. Rows
/// named only by such a label are not attributed to a software group;
/// they fall into 其他软件 like any anonymous helper. Microsoft-signed
/// ones are usually hidden in 系统组件 anyway.
fn is_component_role_label(text: &str) -> bool {
let lower = text.trim().to_lowercase();
let vendor_led = lower.starts_with("windows ") || lower.starts_with("microsoft ");
const ROLES: [&str; 10] = [
"proxy",
"host",
"agent",
"service",
"support",
"helper",
"driver",
"component",
"launcher",
"broker",
];
vendor_led && ROLES.iter().any(|role| lower.ends_with(role))
}
/// Resolve `display_name` (and the software icon) for every scanned
/// entry, once per binary. Also settles `target` / `target_exists`: the
/// binary the row really runs, and whether it is still on disk (a missing
@ -643,8 +667,12 @@ mod windows {
friendly_program_name(&entry.name, description.as_deref(), product.as_deref());
// 电脑管家's grouping rule: an entry is only attributed to a
// software product when the binary carries real human strings;
// everything else falls into the 其他软件 bucket.
entry.named = description.is_some() || product.is_some();
// everything else falls into the 其他软件 bucket. A "Windows
// File System Proxy"-style role label names a plumbing part,
// not a product the user recognises — WinFsp's launcher used to
// open its own fake software group through its FileDescription.
entry.named = (description.is_some() || product.is_some())
&& !is_component_role_label(&entry.display_name);
if !entry.named {
if let Some(product) = windows_store_product(&probed) {
entry.display_name = product;
@ -2492,12 +2520,57 @@ mod windows {
mod tests {
use super::{
approved_enabled, attribute_vendor_suites, clean_module_path, exe_from_command,
friendly_program_name, has_cjk, is_placeholder_label, module_folder_name,
parse_csv_line, split_run_path, suite_path, task_settings_enabled,
friendly_program_name, has_cjk, is_component_role_label, is_placeholder_label,
module_folder_name, parse_csv_line, split_run_path, suite_path, task_settings_enabled,
windows_store_product, write_approved, StartupEntry, CURRENT_VERSION,
};
use winreg::RegKey;
#[test]
fn role_labels_are_not_products() {
// WinFsp's launcher names itself "Windows File System Proxy";
// that is plumbing, so the row must not open its own group.
assert!(is_component_role_label("Windows File System Proxy"));
assert!(is_component_role_label("Microsoft Edge Elevation Service"));
assert!(is_component_role_label(
"Windows Push Notifications User Service"
));
// Real products keep their groups, Chinese or English.
assert!(!is_component_role_label("微信"));
assert!(!is_component_role_label("Windows Defender Firewall"));
assert!(!is_component_role_label("Everything"));
assert!(!is_component_role_label("WinFsp Launcher"));
}
#[test]
fn the_live_scan_leaves_winfsp_unattributed() {
// The user's exact complaint: the WinFsp launcher service opened
// a "Windows File System Proxy" software group of its own.
if !std::path::Path::new(r"C:\Program Files (x86)\WinFsp").exists() {
eprintln!("skipping: no WinFsp on this machine");
return;
}
let entries = super::scan_startup();
let launcher: Vec<_> = entries
.iter()
.filter(|entry| {
entry
.target
.to_lowercase()
.starts_with(r"c:\program files (x86)\winfsp")
})
.collect();
assert!(!launcher.is_empty(), "WinFsp rows vanished");
assert!(
launcher.iter().all(|entry| !entry.named),
"WinFsp still attributed: {:?}",
launcher
.iter()
.map(|entry| (&entry.name, &entry.display_name, entry.named))
.collect::<Vec<_>>()
);
}
#[test]
fn suite_paths_need_a_vendor_and_a_child_folder() {
assert_eq!(

View File

@ -28,6 +28,10 @@ Squid 0.1.13 更新说明
H3C Workspace 的 SpaceAgent、摄像头/打印机/USB/串并口重定向等一组服务,
每个程序都不带产品名信息)自动合并为一组「H3C Workspace」,不再散成
单行组和「其他软件」;带真实产品名的软件不受影响。
- 角色名不再自成一组:WinFsp 的启动服务自称「Windows File System Proxy」,
看着像系统组件实为第三方库,此前在启动列表里开了一个独立的假软件组;
现在这类「Windows/Microsoft + Proxy/Host/Service…)」的角色名一律归入
「其他软件」,真实产品名不受影响。
- 商店应用归组修复:ChatGPT 等微软商店安装的应用此前因为读不到程序信息
而全部堆在「其他软件」,现在按安装包名自动归组(ChatGPT 独立成组,带
自己的图标);「其他软件」组头改用中性九宫格图标,不再借用组内某个