Files
clash-verge-rev/src-tauri/src/core/win_uwp.rs
T
Tunglies 7e9fa61f52 refactor(core): dedupe window listeners, elevated runners, backup settings
- Collapse the close/focus window listener pairs in lightweight.rs onto a shared WindowListener with per-listener event and log label.
- Extract the windows runas-or-direct execution into service::run_maybe_elevated, shared by win_uwp and the service uninstaller, and factor the common uninstaller path resolution and status check shared across platforms.
- Make the auto-backup watch channel the single settings source, replacing the duplicate Arc<RwLock> copy with a stored receiver.
2026-10-28 09:15:45 +08:00

18 lines
406 B
Rust

#![cfg(target_os = "windows")]
use crate::{core::service, utils::dirs};
use anyhow::{Result, bail};
pub fn invoke_uwptools() -> Result<()> {
let resource_dir = dirs::app_resources_dir()?;
let tool_path = resource_dir.join("enableLoopback.exe");
if !tool_path.exists() {
bail!("enableLoopback exe not found");
}
service::run_maybe_elevated(&tool_path, false)?;
Ok(())
}