Skip to content

[codex] Add Windows portable install location picker - #8

Merged
Wangnov merged 1 commit into
mainfrom
codex/issue-6-portable-install-root
Jun 7, 2026
Merged

Wangnov merged 1 commit into
mainfrom
codex/issue-6-portable-install-root

Conversation

@Wangnov

@Wangnov Wangnov commented Jun 7, 2026

Copy link
Copy Markdown
Owner

What changed

  • Added a persisted Windows portable installRoot setting with migration from older settings.json files.
  • Added Tauri dialog support plus win_pick_install_dir and win_set_install_root commands.
  • Validates portable install roots with absolute-path, folder, writable, and free-space checks.
  • Makes Windows install/update/status/uninstall commands read the current persisted install root instead of the startup-only default.
  • Preserves the no-migration rule: if a managed portable install already exists, updates and uninstall continue to use that actual managed path; a changed setting becomes the next fresh-install default.
  • Adds Settings UI for portable install location and a fresh-install location chooser sheet with Default / Browse.

Closes #6

Validation

  • npm run check
  • npm run build
  • cargo check
  • cargo test
  • cargo test --manifest-path crates\codex-win-engine\Cargo.toml
  • cargo clippy
  • cargo clippy --manifest-path crates\codex-win-engine\Cargo.toml --target x86_64-pc-windows-msvc --all-targets -- -D warnings
  • npm run tauri:build

Notes

  • Browser development UI verified the portable Settings row appears after selecting the portable install mode.
  • The actual folder picker is wired through the Tauri dialog plugin and is exercised by the built desktop bundle rather than the in-app browser fallback.

@Wangnov
Wangnov marked this pull request as ready for review June 7, 2026 16:22
…fixes folded in)

Lets Windows users choose where the portable Codex build installs, persisted
across uninstalls. The backend gains a validated `install_root` (migrated from
old settings) used across plan/stage/status/adopt/perform/uninstall; the UI adds
a native folder picker (invoked through a Rust command), a Settings location row,
and a fresh-install location sheet.

Rebased onto main after the i18n PR (#7) merged, so the previously duplicated
install-location strings now come from #7 only. The unused npm
@tauri-apps/plugin-dialog dependency is dropped — the picker goes through a Rust
command and nothing imports the JS binding (the Rust tauri-plugin-dialog stays).

Review fixes folded in:
- validate_install_root_path no longer creates the target directory to probe it
  (it probes the nearest existing ancestor), so selecting/resetting a location
  no longer leaves folders on disk; the dir is created at install time.
- the chosen install root is persisted only AFTER a successful install, and the
  Browse flow is one-shot, so a failed/cancelled attempt keeps the saved default.
- a managed portable build is gracefully closed before MSIX sideload, instead of
  potentially being left running after the switch.
- uninstall and status use is_managed_build (path + build) like the macOS path,
  not path-only is_managed — safer now that the install root is user-configurable
  and paths can be reused.

Co-authored-by: Wangnov <w15365132161@gmail.com>
@Wangnov
Wangnov force-pushed the codex/issue-6-portable-install-root branch from 912dfcd to 4a07ab0 Compare June 7, 2026 17:31
@Wangnov
Wangnov merged commit 205184f into main Jun 7, 2026
3 checks passed
@Wangnov
Wangnov deleted the codex/issue-6-portable-install-root branch June 7, 2026 17:34
Wangnov added a commit that referenced this pull request Jun 7, 2026
Ships the i18n (11 languages + Arabic RTL, #7) and Windows portable install
location picker (#8) work on top of the released v0.1.0. Bumps all version
sources in lockstep — package.json, package-lock.json, tauri.conf.json,
Cargo.toml, Cargo.lock — so the built app version matches the v0.1.1 tag that
drives latest.json (mismatch would loop the updater).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows(portable): 安装时让用户选安装位置并持久化

1 participant