mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
## What changed Read `desktop.uninstall_codex_home` from the owner's current `config.toml` before recursively deleting a desktop-created Codex home during Windows sandbox uninstall. - Preserve the home by default for ordinary installations; retain the deletion default for OEM preinstalls when no preference is set. - Let an explicit boolean preference override either default. Preserve the home when configuration is unreadable, malformed, or contains an invalid preference. - Capture OEM metadata before Windows removes it during uninstall, and revoke sandbox permissions on retained homes. ## Testing Add unit tests for missing preferences, explicit overrides, malformed or invalid configuration, and configuration read failures across both installation defaults. GitOrigin-RevId: 46afc2a7b0f4ecf7f447e46b515e50d0d278e4a8
46 lines
873 B
Rust
46 lines
873 B
Rust
use anyhow::Result;
|
|
|
|
#[cfg(windows)]
|
|
mod installation_record;
|
|
#[cfg(windows)]
|
|
mod ipc;
|
|
|
|
#[cfg(windows)]
|
|
mod machine_policy;
|
|
#[cfg(windows)]
|
|
mod package_identity;
|
|
#[cfg(windows)]
|
|
mod package_lifecycle;
|
|
#[cfg(windows)]
|
|
mod provisioning;
|
|
#[cfg(windows)]
|
|
mod registered_runtime;
|
|
#[cfg(windows)]
|
|
mod service;
|
|
#[cfg(any(windows, test))]
|
|
mod uninstall_policy;
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
pub enum RunMode {
|
|
Service,
|
|
#[cfg(debug_assertions)]
|
|
Foreground,
|
|
}
|
|
|
|
pub fn run(mode: RunMode) -> Result<()> {
|
|
#[cfg(windows)]
|
|
{
|
|
match mode {
|
|
RunMode::Service => service::run(),
|
|
#[cfg(debug_assertions)]
|
|
RunMode::Foreground => service::run_foreground(),
|
|
}
|
|
}
|
|
|
|
#[cfg(not(windows))]
|
|
{
|
|
let _ = mode;
|
|
anyhow::bail!("the Codex sandbox service is only available on Windows")
|
|
}
|
|
}
|