{"record":{"id":"7ec426303f553d77","repo":"BigPizzaV3/CodexPlusPlus","slug":"windows-shortcuts-are-only-supported-on-windows","errorCode":null,"errorMessage":"Windows shortcuts are only supported on Windows","messagePattern":"Windows shortcuts are only supported on Windows","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/install/windows.rs","lineNumber":122,"sourceCode":"    let _ = crate::windows_integration::delete_current_user_key(URL_PROTOCOL_SUBKEY);\n    let _ = crate::windows_integration::delete_current_user_key(&format!(\n        r\"{DREAM_SKIN_URL_PROTOCOL_SUBKEY}\\shell\\open\\command\"\n    ));\n    let _ = crate::windows_integration::delete_current_user_key(&format!(\n        r\"{DREAM_SKIN_URL_PROTOCOL_SUBKEY}\\shell\\open\"\n    ));\n    let _ = crate::windows_integration::delete_current_user_key(&format!(\n        r\"{DREAM_SKIN_URL_PROTOCOL_SUBKEY}\\shell\"\n    ));\n    let _ = crate::windows_integration::delete_current_user_key(DREAM_SKIN_URL_PROTOCOL_SUBKEY);\n    let _ = crate::windows_integration::delete_current_user_key(LEGACY_UNINSTALL_SUBKEY);\n    let _ = crate::windows_integration::delete_current_user_key(UNINSTALL_SUBKEY);\n    Ok(())\n}\n\n#[cfg(not(windows))]\npub fn install_shortcuts(_options: &InstallOptions) -> anyhow::Result<()> {\n    anyhow::bail!(\"Windows shortcuts are only supported on Windows\")\n}\n\n#[cfg(not(windows))]\npub fn uninstall_shortcuts(_options: &InstallOptions) -> anyhow::Result<()> {\n    anyhow::bail!(\"Windows shortcuts are only supported on Windows\")\n}\n\n#[cfg(windows)]\nfn create_entrypoint_shortcut(\n    path: PathBuf,\n    target: PathBuf,\n    description: &str,\n    icon: PathBuf,\n) -> anyhow::Result<()> {\n    crate::windows_integration::create_shortcut(&crate::windows_integration::ShortcutSpec {\n        working_directory: target.parent().map(Path::to_path_buf),\n        path,\n        target,","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/install/windows.rs#L104-L140","documentation":"The non-Windows stub of windows::install_shortcuts unconditionally bails with this message. The real shortcut-creation code (Start Menu / desktop .lnk via COM) is cfg(windows)-only, so calling this function from any other platform is a hard error by design.","triggerScenarios":"Any call to install_shortcuts in a binary compiled for a non-Windows target — e.g. install flow that doesn't check cfg before invoking the shortcut step.","commonSituations":"Cross-platform install code paths not gated per-OS; testing install on macOS/Linux; CI running install for a linux target with shortcut steps enabled.","solutions":["Only call install_shortcuts when compiling for / running on Windows (cfg gate or runtime check)","Skip the shortcuts step on other platforms instead of treating it as required","Use platform_install, which already dispatches per-OS, rather than calling windows::install_shortcuts directly"],"exampleFix":"// before\nwindows::install_shortcuts(&options)?;\n// after\n#[cfg(windows)]\nwindows::install_shortcuts(&options)?;","handlingStrategy":"type-guard","validationCode":"#[cfg(windows)]\nwindows::install_shortcuts(&options)?;\n#[cfg(not(windows))]\neprintln!(\"shortcut installation skipped: Windows only\");","typeGuard":"fn supports_windows_shortcuts() -> bool { cfg!(windows) }","tryCatchPattern":"if let Err(e) = install_shortcuts(&options) {\n    if e.to_string().contains(\"only supported on Windows\") { eprintln!(\"skipped on this platform\"); }\n    else { return Err(e); }\n}","preventionTips":["Never call windows::install_shortcuts directly from cross-platform code; use platform_install dispatch","Guard shortcut steps with #[cfg(windows)]","Keep shortcut creation optional and skippable in install flows"],"tags":["windows","shortcuts","platform"],"backgroundTag":"unsupported-platform","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}