Files
codex/codex-rs/windows-sandbox-service/Cargo.toml
T
chess 872fc22f9c Complete Windows sandbox uninstall cleanup (#45799)
## Why

Packaged uninstall could leave sandbox user profiles and desktop-created data behind. Cleanup also needs to handle a service stop before package removal completes without deleting data belonging to an update or reinstall.

## What changed

- Delete sandbox profiles before their accounts, preserving accounts for retry when profile deletion fails. Defer retained runtime accounts and the sandbox group until runtime registrations are removed and profiles unload.
- Allow cleanup while the exact retiring package is still registered, while preserving desktop data when a successor package is present.
- Remove desktop-created Codex homes during registered runtime cleanup, preserve existing CLI data, and prune empty home and cache directories. Keep directory pins through retries and avoid privileged traversal after releasing the home.
- Retry cleanup up to five attempts after a service stop, while retaining shutdown cancellation behavior.
- Report cleanup outcomes in the Windows Event Log and emit final completion after registered runtime cleanup finishes. Remove the empty installation registry parent.

## Testing

Add Windows tests for profile deletion retry and account preservation, service-stop retries versus system shutdown, and PowerShell finalizer parsing and native binding compilation. Extend retained-token coverage to check account SID matching.

GitOrigin-RevId: 1aefa969e6aff9bb8e77e2c9fe9ee772230fc4fb
2026-09-15 21:33:16 +00:00

65 lines
1.5 KiB
TOML

[package]
name = "codex-windows-sandbox-service"
version.workspace = true
edition.workspace = true
license.workspace = true
[lib]
name = "codex_windows_sandbox_service"
path = "src/lib.rs"
doctest = false
[[bin]]
name = "codex-windows-sandbox-service"
path = "src/main.rs"
[lints]
workspace = true
[dependencies]
anyhow = { workspace = true }
codex-cloud-config = { workspace = true }
codex-config = { workspace = true }
codex-core = { workspace = true }
codex-windows-sandbox = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt", "sync", "time"] }
toml = { workspace = true }
[dev-dependencies]
pretty_assertions = { workspace = true }
[target.'cfg(windows)'.dependencies.windows]
version = "0.58"
features = [
"ApplicationModel",
"Foundation_Collections",
"Management_Deployment",
"Win32_System_WinRT",
]
[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52"
features = [
"Win32_Foundation",
"Win32_NetworkManagement_NetManagement",
"Win32_Security",
"Win32_Security_Authorization",
"Win32_Storage_FileSystem",
"Win32_Storage_Packaging_Appx",
"Win32_System_Com",
"Win32_System_Environment",
"Win32_System_EventLog",
"Win32_System_IO",
"Win32_System_JobObjects",
"Win32_System_Memory",
"Win32_System_Pipes",
"Win32_System_Registry",
"Win32_System_RemoteDesktop",
"Win32_System_Services",
"Win32_System_SystemServices",
"Win32_System_SystemInformation",
"Win32_System_Threading",
"Win32_UI_Shell",
]