BigPizzaV3/CodexPlusPlus · error · anyhow::Error
Packaged app activation is only supported on Windows
Error message
Packaged app activation is only supported on Windows
What it means
`activate_packaged_app` launches an app by AppUserModelId via Windows shell activation (IApplicationActivationManager). This Win32 COM mechanism does not exist on other OSes, so the non-Windows cfg stub refuses the call outright. The error states the platform restriction explicitly.
Solutions
- Run the packaged-app activation flow only on Windows (guard callers with #[cfg(windows)] or a runtime OS check)
- On non-Windows, launch the equivalent app via its normal executable/bundle path (e.g. `open` on macOS) instead of AUMID activation
- Update UI/CLI to hide the activate-packaged-app action on non-Windows platforms
Example fix
// before
pub async fn activate_packaged_app(aumid: &str, args: &str) -> anyhow::Result<u32> { activate_packaged_app(aumid, args).await }
// after
if !cfg!(windows) {
anyhow::bail!("packaged app activation is Windows-only; launch the executable directly instead");
} Defensive patterns
Strategy: fallback
Validate before calling
if !cfg!(windows) {
// use platform-native launch instead
return launch_via_native_path(executable, args);
} Type guard
fn supports_packaged_app_activation() -> bool { cfg!(windows) } Try / catch
match activate_packaged_app(aumid, args).await {
Ok(pid) => {},
Err(e) if e.to_string().contains("only supported on Windows") => launch_via_native_path(fallback_exe, args)?,
Err(e) => return Err(e),
} Prevention
- Hide packaged-app actions from non-Windows UI
- Provide a non-packaged executable fallback for all platforms
- Check OS at startup and configure launch strategy accordingly
- Document that AUMID activation is Windows-only
When it happens
Trigger: Calling activate_packaged_app with an app_user_model_id on macOS/Linux, or a cross-platform flow (e.g. debug takeover or manager launch) that reaches the non-Windows stub.
Common situations: Trying to launch a Windows Store/packaged app (e.g. a packaged Codex UI) from a non-Windows dev machine; cross-platform code not branching on target_os before activation.
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
- cannot terminate Windows process id
- cannot wait for Windows process id
- failed to open DevTools URL
- failed to wait for Windows process id
- Native browser compatibility is Windows-only
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/962713b82b3f082d.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/launcher.rs:3254
}
_ => {
output.push_str(&"\\".repeat(backslashes));
output.push(ch);
backslashes = 0;
}
}
}
output.push_str(&"\\".repeat(backslashes * 2));
output.push('"');
output
}
#[cfg(not(windows))]
pub async fn activate_packaged_app(
_app_user_model_id: &str,
_arguments: &str,
) -> anyhow::Result<u32> {
anyhow::bail!("Packaged app activation is only supported on Windows")
}
#[cfg(windows)]
pub async fn activate_packaged_app(
app_user_model_id: &str,
arguments: &str,
) -> anyhow::Result<u32> {
let app_user_model_id = app_user_model_id.to_string();
let arguments = arguments.to_string();
tokio::task::spawn_blocking(move || {
activate_packaged_app_blocking(&app_user_model_id, &arguments)
})
.await
.context("packaged app activation task failed")?
}
#[cfg(windows)]
fn activate_packaged_app_blocking(app_user_model_id: &str, arguments: &str) -> anyhow::Result<u32> {View on GitHub (pinned to b1ed92e5e4)