BigPizzaV3/CodexPlusPlus · error

Windows shortcuts are only supported on Windows

Error message

Windows shortcuts are only supported on Windows

What it means

Thrown by install_shortcuts compiled under cfg(not(windows)) — the stub implementation that exists so non-Windows builds still link. Any call to install Windows shortcuts (Run key, uninstall entries, URL protocol subkeys) on a non-Windows host hits this sentinel; the trigger is the platform mismatch itself, and the uninstall_shortcuts caller path surfaces it.

Source

Thrown at crates/codex-plus-core/src/install/windows.rs:127

        r"{DREAM_SKIN_URL_PROTOCOL_SUBKEY}\shell\open"
    ));
    let _ = crate::windows_integration::delete_current_user_key(&format!(
        r"{DREAM_SKIN_URL_PROTOCOL_SUBKEY}\shell"
    ));
    let _ = crate::windows_integration::delete_current_user_key(DREAM_SKIN_URL_PROTOCOL_SUBKEY);
    let _ = crate::windows_integration::delete_current_user_key(LEGACY_UNINSTALL_SUBKEY);
    let _ = crate::windows_integration::delete_current_user_key(UNINSTALL_SUBKEY);
    Ok(())
}

#[cfg(not(windows))]
pub fn install_shortcuts(_options: &InstallOptions) -> anyhow::Result<()> {
    anyhow::bail!("Windows shortcuts are only supported on Windows")
}

#[cfg(not(windows))]
pub fn uninstall_shortcuts(_options: &InstallOptions) -> anyhow::Result<()> {
    anyhow::bail!("Windows shortcuts are only supported on Windows")
}

#[cfg(windows)]
fn create_entrypoint_shortcut(
    path: PathBuf,
    target: PathBuf,
    description: &str,
    icon: PathBuf,
) -> anyhow::Result<()> {
    crate::windows_integration::create_shortcut(&crate::windows_integration::ShortcutSpec {
        working_directory: target.parent().map(Path::to_path_buf),
        path,
        target,
        arguments: String::new(),
        description: description.to_string(),
        icon: Some(icon),
        show_minimized: false,
    })

View on GitHub (pinned to f2074595a2)

Solutions

  1. 在 Windows 平台调用快捷方式安装/卸载
  2. 非 Windows 平台走各自的 platform_install 路径
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/install/windows.rs:127 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/7ec426303f553d77. Report an issue: GitHub.