{"record":{"id":"67008f14f2e59528","repo":"libnyanpasu/clash-nyanpasu","slug":"enableloopback-exe-not-found","errorCode":null,"errorMessage":"enableLoopback exe not found","messagePattern":"enableLoopback exe not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/tauri/src/core/win_uwp.rs","lineNumber":14,"sourceCode":"#![cfg(target_os = \"windows\")]\n\nuse crate::utils::dirs;\nuse anyhow::{Result, bail};\nuse deelevate::{PrivilegeLevel, Token};\nuse runas::Command as RunasCommand;\nuse std::process::Command as StdCommand;\n\npub async fn invoke_uwptools() -> Result<()> {\n    let resource_dir = dirs::app_resources_dir()?;\n    let tool_path = resource_dir.join(\"enableLoopback.exe\");\n\n    if !tool_path.exists() {\n        bail!(\"enableLoopback exe not found\");\n    }\n\n    let token = Token::with_current_process()?;\n    let level = token.privilege_level()?;\n\n    match level {\n        PrivilegeLevel::NotPrivileged => RunasCommand::new(tool_path).status()?,\n        _ => StdCommand::new(tool_path).status()?,\n    };\n\n    Ok(())\n}\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/core/win_uwp.rs#L1-L27","documentation":"invoke_uwptools runs the UWP loopback-exemption helper by executing enableLoopback.exe from the app's resources directory. Before invoking it, it checks the file exists; if the executable is missing it bails with \"enableLoopback exe not found\". This prevents trying to spawn a nonexistent process.","triggerScenarios":"Calling invoke_uwptools (e.g. from the UWP loopback feature in the UI) on a machine where <app_resources_dir>/enableLoopback.exe is absent — an incomplete install, a resource-bundling failure, or running a non-Windows/dev build without the bundled tool.","commonSituations":"Portable/zip installs that skipped the installer's resource placement; antivirus quarantining enableLoopback.exe; dev builds where tauri resources were not bundled; users trying the UWP loopback toggle on a broken installation.","solutions":["Reinstall the application (or re-run the installer) so enableLoopback.exe is placed in the app resources directory.","Verify the file exists at the app resources dir (Settings → Open App Dir → check resources/enableLoopback.exe); restore it from a fresh download if antivirus removed it.","In dev, ensure `cargo tauri dev` / build config includes the tool in the resources bundle."],"exampleFix":"// before\nlet tool_path = resource_dir.join(\"enableLoopback.exe\");\ninvoke_uwptools()?; // bails if missing\n// after\nlet tool_path = resource_dir.join(\"enableLoopback.exe\");\nif !tool_path.exists() {\n    eprintln!(\"run installer repair to restore enableLoopback.exe\");\n    return;\n}\ninvoke_uwptools()?;","handlingStrategy":"validation","validationCode":"let tool_path = dirs::app_resources_dir()?.join(\"enableLoopback.exe\");\nif !tool_path.exists() {\n    eprintln!(\"enableLoopback.exe missing at {} — repair the installation\", tool_path.display());\n    return;\n}","typeGuard":null,"tryCatchPattern":"match invoke_uwptools().await {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"enableLoopback exe not found\") => {\n        // surface an install-repair hint to the user\n    },\n    Err(e) => return Err(e),\n}","preventionTips":["Use the official installer so bundled resources are always placed.","Whitelist the app directory in antivirus to avoid quarantining the tool.","After updating, verify resources/enableLoopback.exe exists before offering the UWP loopback toggle in the UI."],"tags":["windows","uwp","missing-file"],"backgroundTag":"file-not-found","analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}