{"record":{"id":"0da8cd8bb15083b1","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-0da8cd","errorCode":null,"errorMessage":"当前平台不支持启动安装包","messagePattern":"当前平台不支持启动安装包","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/update.rs","lineNumber":433,"sourceCode":"            .creation_flags(crate::windows_integration::CREATE_NO_WINDOW)\n            .spawn()\n            .map(|_| ())\n            .map_err(|error| anyhow::anyhow!(\"启动安装包失败：{error}\"))\n    }\n\n    #[cfg(target_os = \"macos\")]\n    {\n        std::process::Command::new(\"open\")\n            .arg(path)\n            .spawn()\n            .map(|_| ())\n            .map_err(|error| anyhow::anyhow!(\"打开 DMG 失败：{error}\"))\n    }\n\n    #[cfg(all(not(windows), not(target_os = \"macos\")))]\n    {\n        let _ = path;\n        anyhow::bail!(\"当前平台不支持启动安装包\")\n    }\n}\n","sourceCodeStart":415,"sourceCodeEnd":436,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/1f431ae49b57b3055e0e6845ba6156c6b4232b4d/crates/codex-plus-core/src/update.rs#L415-L436","documentation":"launch_installer implements only Windows (spawn the installer) and macOS (open the DMG). On every other platform — Linux, BSD — it unconditionally bails with \"当前平台不支持启动安装包\"; there is no code path that could succeed, and the path argument is deliberately discarded (let _ = path).","triggerScenarios":"Compiling/running the manager on Linux and invoking the install-update flow that ends in launch_installer; e2e tests calling launch_installer on Linux CI runners.","commonSituations":"Community Linux builds of a primarily Windows/macOS app; automation not gated by cfg attributes; users on unsupported platforms clicking an install button that should have been hidden.","solutions":["Gate the UI/action behind an OS check so the option never appears on unsupported platforms","Download the asset manually and install by hand on Linux","If you maintain the app, implement a Linux path (e.g. open the containing folder or run an AppImage) instead of bailing","In tests, cfg-skip the launch step on non-Windows/macOS platforms"],"exampleFix":"// before\nlaunch_installer(&install.installer_path)?;\n\n// after\n#[cfg(any(windows, target_os = \"macos\"))]\nlaunch_installer(&install.installer_path)?;\n#[cfg(all(not(windows), not(target_os = \"macos\")))]\n{\n    let _ = &install.installer_path;\n    // open the download folder instead of failing\n}","handlingStrategy":"validation","validationCode":"if !cfg!(any(windows, target_os = \"macos\")) {\n    anyhow::bail!(\"installer launch is unsupported on this OS; install manually\");\n}\nlaunch_installer(&install.installer_path)?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate install/update buttons with a compile-time or runtime OS check","cfg-skip e2e steps that call launch_installer on Linux CI","Offer a manual-download fallback on platforms without launcher support"],"tags":["platform-support","linux","installer","update"],"backgroundTag":"unsupported-platform","analyzedSha":"1f431ae49b57b3055e0e6845ba6156c6b4232b4d","analyzedAt":"2026-08-16T20:54:18.598Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}