{"record":{"id":"b1856f65cbcab709","repo":"rustdesk/rustdesk","slug":"the-driver-inf-file-does-not-exists","errorCode":null,"errorMessage":"The driver inf file \"{}\" does not exists","messagePattern":"The driver inf file \"(.+?)\" does not exists","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/remote_printer/src/setup/setup.rs","lineNumber":26,"sourceCode":"use windows_strings::PCWSTR;\n\nlazy_static::lazy_static!(\n    static ref SETUP_MTX: Mutex<()> = Mutex::new(());\n);\n\nfn get_driver_inf_abs_path() -> ResultType<PathBuf> {\n    use crate::RD_DRIVER_INF_PATH;\n\n    let exe_file = std::env::current_exe()?;\n    let abs_path = match exe_file.parent() {\n        Some(parent) => parent.join(RD_DRIVER_INF_PATH),\n        None => bail!(\n            \"Invalid exe parent for {}\",\n            exe_file.to_string_lossy().as_ref()\n        ),\n    };\n    if !abs_path.exists() {\n        bail!(\n            \"The driver inf file \\\"{}\\\" does not exists\",\n            RD_DRIVER_INF_PATH\n        )\n    }\n    Ok(abs_path)\n}\n\n// Note: This function must be called in a separate thread.\n// Because many functions in this module are blocking or synchronous.\n// Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.\n// Steps:\n// 1. Add the local port.\n// 2. Check if the driver is installed.\n//    Uninstall the existing driver if it is installed.\n//    We should not check the driver version because the driver is deployed with the application.\n//    It's better to uninstall the existing driver and install the driver from the application.\n// 3. Add the printer.\npub fn install_update_printer(app_name: &str) -> ResultType<()> {","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/rustdesk/rustdesk/blob/91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540/libs/remote_printer/src/setup/setup.rs#L8-L44","documentation":"get_driver_inf_abs_path resolves the absolute path of the RustDesk virtual printer driver INF file (RD_DRIVER_INF_PATH) relative to the current executable's parent directory. This bail fires when that resolved path does not exist on disk, meaning the driver INF file is missing from the installation, so install_update_printer cannot proceed to install or update the printer driver.","triggerScenarios":"Calling install_update_printer (which calls get_driver_inf_abs_path) when the file at RD_DRIVER_INF_PATH, resolved from the executable's parent directory, does not exist on disk.","commonSituations":"Running a partially built or manually copied rustdesk binary without the bundled driver files; an installer that skipped the printer driver component; the exe not located in its normal install layout so the relative INF path resolves elsewhere.","solutions":["Verify the INF file referenced by RD_DRIVER_INF_PATH exists at '<exe parent dir>/...' and reinstall the printer driver component if missing","Reinstall/repair RustDesk so the driver files are extracted to the expected location next to the executable","Ensure the application is launched from its installed directory, not a bare copied binary","Check installer logs / packaging to confirm the driver INF is included in the deployment"],"exampleFix":"// ensure the INF ships beside the binary before calling install\nlet inf = setup::get_driver_inf_abs_path()?;\nif !inf.exists() {\n    eprintln!(\"driver INF missing: {}\", inf.display());\n}\nsetup::install_update_printer()?;","handlingStrategy":"validation","validationCode":"let inf = setup::get_driver_inf_abs_path()?;\nif !inf.exists() {\n    eprintln!(\"printer driver INF missing at {}\", inf.display());\n}","typeGuard":null,"tryCatchPattern":"match setup::install_update_printer() {\n    Ok(_) => {},\n    Err(e) if e.to_string().contains(\"does not exists\") => reinstall_driver(),\n    Err(e) => return Err(e),\n}","preventionTips":["Verify the full install layout (exe + driver files) after installation","Never run the printer setup from a bare copied binary","Include the driver INF in packaging/installer checks"],"tags":["rust","printer-driver","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540","analyzedAt":"2026-09-10T19:53:44.083Z","contentChangedAt":"2026-09-10T19:53:44.083Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}