mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-31 19:32:13 +08:00
- 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.
18 lines
406 B
Rust
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(())
|
|
}
|