{"record":{"id":"dd0d5449ccd2850b","repo":"denoland/deno","slug":"no-desktop-file-found-in","errorCode":null,"errorMessage":"no .desktop file found in {}","messagePattern":"no \\.desktop file found in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/desktop.rs","lineNumber":821,"sourceCode":"    plist::Value::Array(vec![plist::Value::Dictionary(url_type)]),\n  );\n\n  plist::to_file_xml(&plist_path, &dict)\n    .with_context(|| format!(\"failed to write {}\", plist_path.display()))?;\n  Ok(())\n}\n\n/// Linux: add `x-scheme-handler/<scheme>` MIME types to the `.desktop` entry\n/// and make sure `Exec=` forwards the opened URL via the `%u` field code.\nfn register_deep_links_linux(\n  bundle_path: &Path,\n  schemes: &[String],\n) -> Result<(), AnyError> {\n  let desktop_file = std::fs::read_dir(bundle_path)?\n    .filter_map(|e| e.ok().map(|e| e.path()))\n    .find(|p| p.extension().is_some_and(|e| e == \"desktop\"))\n    .ok_or_else(|| {\n      deno_core::anyhow::anyhow!(\n        \"no .desktop file found in {}\",\n        bundle_path.display()\n      )\n    })?;\n\n  let contents = std::fs::read_to_string(&desktop_file)?;\n  let mime = schemes\n    .iter()\n    .map(|s| format!(\"x-scheme-handler/{s};\"))\n    .collect::<String>();\n\n  let mut out = String::with_capacity(contents.len() + mime.len() + 16);\n  let mut wrote_mime = false;\n  for line in contents.lines() {\n    if let Some(rest) = line.strip_prefix(\"Exec=\") {\n      // The launcher must receive the URL as an argument, so ensure a `%u`\n      // field code is present exactly once.\n      if rest.contains(\"%u\") || rest.contains(\"%U\") {","sourceCodeStart":803,"sourceCodeEnd":839,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/desktop.rs#L803-L839","documentation":"While registering deep links for a compiled desktop app on Linux, Deno scans the app bundle for a `.desktop` entry file to add `x-scheme-handler/<scheme>` MIME types and an `Exec=... %u` field code. If no `*.desktop` file exists in the bundle directory, registration aborts with this error.","triggerScenarios":"Deep-link registration (schemes declared in the desktop configuration) run against a bundle directory that contains no `.desktop` file — the bundle was built without the desktop packaging step, or the directory was assembled or modified by hand.","commonSituations":"Older or custom-built bundles; artifacts copied piecemeal out of the build output; packaging steps that renamed or deleted the `.desktop` file before registration.","solutions":["Rebuild the desktop bundle with the current deno version so the `.desktop` entry is generated","If you customize packaging, ensure a valid `<App>.desktop` file lands in the bundle root before deep-link registration","List the bundle directory — the `.desktop` file should sit alongside the executable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-check the bundle before registering deep links\nconst bundleDir = \"./dist/myapp\";\nconst hasDesktopEntry = [...Deno.readDirSync(bundleDir)].some((e) =>\n  e.name.endsWith(\".desktop\")\n);\nif (!hasDesktopEntry) {\n  throw new Error(\"bundle has no .desktop file — rebuild before registering schemes\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Register deep links only against freshly built bundles","Don't hand-modify build outputs before registration","Keep packaging steps from renaming or dropping the .desktop file"],"tags":["desktop","linux","deep-links","packaging"],"backgroundTag":"missing-desktop-entry-file","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}