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:
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user