refactor: remove direct Windows metrics from tunnel_manager and update wg.exe fallback in tunnel-helper

Remove direct_windows_metrics, read_windows_metrics_from_show, parse_human_wireguard_bytes, and find_windows_wg functions from tunnel_manager.rs to rely on bundled backend for all metrics queries. Update find_wg_cli in tunnel-helper to return "wg.exe" as fallback when WireGuard installation paths don't exist, removing "wg" from candidate list.
This commit is contained in:
2026-03-18 09:49:20 +01:00
parent ab7275059f
commit eff143d5b3
2 changed files with 5 additions and 163 deletions

View File

@@ -735,15 +735,15 @@ fn read_transfer_totals(profile: &Path) -> Result<(u64, u64), String> {
#[cfg(target_os = "windows")]
fn find_wg_cli() -> Result<PathBuf, String> {
let candidates = [
PathBuf::from("wg"),
PathBuf::from(r"C:\Program Files\WireGuard\wg.exe"),
PathBuf::from(r"C:\Program Files (x86)\WireGuard\wg.exe"),
];
candidates
.into_iter()
.find(|path| path.exists())
.ok_or_else(|| "required Windows WireGuard CLI is not available".to_string())
if let Some(path) = candidates.into_iter().find(|path| path.exists()) {
return Ok(path);
}
Ok(PathBuf::from("wg.exe"))
}
#[cfg(target_os = "macos")]