libnyanpasu/clash-nyanpasu · error

enableLoopback exe not found

Error message

enableLoopback exe not found

What it means

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.

Source

Thrown at backend/tauri/src/core/win_uwp.rs:14

#![cfg(target_os = "windows")]

use crate::utils::dirs;
use anyhow::{Result, bail};
use deelevate::{PrivilegeLevel, Token};
use runas::Command as RunasCommand;
use std::process::Command as StdCommand;

pub async 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");
    }

    let token = Token::with_current_process()?;
    let level = token.privilege_level()?;

    match level {
        PrivilegeLevel::NotPrivileged => RunasCommand::new(tool_path).status()?,
        _ => StdCommand::new(tool_path).status()?,
    };

    Ok(())
}

View on GitHub (pinned to f7dbce2997)

Solutions

  1. Reinstall the application (or re-run the installer) so enableLoopback.exe is placed in the app resources directory.
  2. 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.
  3. In dev, ensure `cargo tauri dev` / build config includes the tool in the resources bundle.

Example fix

// before
let tool_path = resource_dir.join("enableLoopback.exe");
invoke_uwptools()?; // bails if missing
// after
let tool_path = resource_dir.join("enableLoopback.exe");
if !tool_path.exists() {
    eprintln!("run installer repair to restore enableLoopback.exe");
    return;
}
invoke_uwptools()?;
Defensive patterns

Strategy: validation

Validate before calling

let tool_path = dirs::app_resources_dir()?.join("enableLoopback.exe");
if !tool_path.exists() {
    eprintln!("enableLoopback.exe missing at {} — repair the installation", tool_path.display());
    return;
}

Try / catch

match invoke_uwptools().await {
    Ok(()) => {},
    Err(e) if e.to_string().contains("enableLoopback exe not found") => {
        // surface an install-repair hint to the user
    },
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08). Data as JSON: /api/errors/67008f14f2e59528. Report an issue: GitHub.