BigPizzaV3/CodexPlusPlus · warning

当前平台不支持启动安装包

Error message

当前平台不支持启动安装包

What it means

launch_installer opens the downloaded update installer with a platform-specific command (Windows ShellExecute-style open, macOS `open` for DMG). The `#[cfg(all(not(windows), not(target_os = "macos")))]` fallback arm intentionally does nothing but bail: on Linux/BSD and other platforms there is no supported installer-launch mechanism in this code path.

Solutions

  1. On Linux, skip the auto-launch step and instead run the downloaded installer/archive manually.
  2. Add a Linux arm to launch_installer (e.g. make the AppImage executable and spawn it) if your fork targets Linux.
  3. Gate the 'launch installer' UI action by platform so Linux users get a 'download complete, install manually' message.

Example fix

// before (caller)
perform_update(...)?; // implicitly launches installer
// after
if cfg!(any(windows, target_os = "macos")) {
    perform_update(...)?;
} else {
    download_update_only(...)?; // user installs manually
}
Defensive patterns

Strategy: fallback

Validate before calling

#[cfg(all(not(windows), not(target_os = "macos")))]
let can_auto_launch = false;
#[cfg(any(windows, target_os = "macos"))]
let can_auto_launch = true;
if can_auto_launch { perform_update(...)?; } else { show_manual_install_instructions(); }

Try / catch

if let Err(e) = perform_update(...) {
    if e.to_string().contains("当前平台不支持启动安装包") {
        open_downloaded_file_location(); // let user install manually
    } else { return Err(e); }
}

Prevention

When it happens

Trigger: Calling perform_update → launch_installer on a non-Windows, non-macOS platform (e.g. Linux) after downloading the release asset; or a build where the platform cfg arms above were compiled out.

Common situations: Running the desktop manager on Linux and clicking 'update now'; CI containers on ubuntu images exercising the update flow; architectures where the matched platform_asset_rank picks a generic archive rather than a launchable installer.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/0da8cd8bb15083b1. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/update.rs:433

            .creation_flags(crate::windows_integration::CREATE_NO_WINDOW)
            .spawn()
            .map(|_| ())
            .map_err(|error| anyhow::anyhow!("启动安装包失败:{error}"))
    }

    #[cfg(target_os = "macos")]
    {
        std::process::Command::new("open")
            .arg(path)
            .spawn()
            .map(|_| ())
            .map_err(|error| anyhow::anyhow!("打开 DMG 失败:{error}"))
    }

    #[cfg(all(not(windows), not(target_os = "macos")))]
    {
        let _ = path;
        anyhow::bail!("当前平台不支持启动安装包")
    }
}

View on GitHub (pinned to b1ed92e5e4)