Skip to content

fix(cua-driver-rs)(dev): install-local.ps1 mirrors install.ps1 param surface + v0.2.14+ paths - #1655

Merged
f-trycua merged 1 commit into
mainfrom
fix/install-local-ps1-param-alignment-paths
May 22, 2026
Merged

fix(cua-driver-rs)(dev): install-local.ps1 mirrors install.ps1 param surface + v0.2.14+ paths#1655
f-trycua merged 1 commit into
mainfrom
fix/install-local-ps1-param-alignment-paths

Conversation

@f-trycua

@f-trycua f-trycua commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Dev-script polish so the local-build install loop matches what end users experience via `install.ps1`.

Two changes in `scripts/install-local.ps1`:

  1. Path defaults updated to v0.2.14+ layout:

    • `%LOCALAPPDATA%\Programs\trycua\cua-driver-rs\bin` → `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin`
    • `/.cua-driver-rs` → `/.cua-driver`

    Without this, local-build installs landed at the LEGACY paths while `install.ps1` produces the new paths — the `current` junction couldn't flip between them.

  2. Param surface mirrors `install.ps1`:

    Final param surface: `-AutoStart`, `-NoPathUpdate` — exact subset of install.ps1's user-facing params. If a dev wants a debug build for faster compile iteration, invoke `cargo build -p cua-driver` directly and use `target\debug\cua-driver.exe`.

Why dev-only

`install-local.ps1` is not used by end users (`irm install.ps1 | iex` fetches a built release). This change makes the dev iteration loop cleaner: edit Rust source, run `install-local.ps1`, get a binary at the SAME paths the real install would produce. No more "wait, why is my local build in `trycua\cua-driver-rs` while my release install is in `Cua\cua-driver`?".

Test plan

  • cargo build -p cua-driver clean
  • install-local.ps1 on fbonacci's VM produces binary at %LOCALAPPDATA%\\Programs\\Cua\\cua-driver\\bin\\cua-driver.exe
  • Re-running install-local.ps1 retargets the current junction to the fresh build (atomic upgrade)
  • -NoPathUpdate skips the PATH write
  • -AutoStart registers the cua-driver-serve task

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added -NoPathUpdate parameter to control whether installation modifies the system PATH.
  • Chores

    • Updated local installation script to always build in release mode.
    • Aligned default installation paths with production installer standards.
    • Simplified build process workflow.

Review Change Stack

…surface + v0.2.14+ paths

Dev-script polish so the local-build install loop matches what end users
experience. Two changes:

1. **Path defaults**: switch the visible bin dir and package home defaults
   to v0.2.14+ layout (`Programs\Cua\cua-driver` + `~/.cua-driver`).
   Previously install-local.ps1 was still using the legacy
   `trycua\cua-driver-rs` paths, which meant local-build installs landed
   in a different location than what install.ps1 produces — and the
   `current` junction couldn't flip between them.

2. **Param surface mirrors install.ps1**: drop the `-Release` switch
   (which conflicted in meaning with install.ps1's `-Release "<version>"`
   tag selector — confusing for anyone bouncing between the two scripts)
   and always build release-mode (matches what install.ps1 hands users —
   the GitHub Releases zip is `--release`). Add `-NoPathUpdate` switch +
   corresponding User-PATH update step (also writes $env:Path in the
   current shell so cua-driver resolves immediately, matching PR #1652
   / #1651's behavior). Keep `-AutoStart` as-is.

Final param surface: `-AutoStart`, `-NoPathUpdate` — exact subset of
install.ps1's user-facing params. If a dev wants a debug build for
faster compile iteration, invoke `cargo build -p cua-driver` and use
target\debug\cua-driver.exe directly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview May 22, 2026 6:23pm

Request Review

@f-trycua
f-trycua merged commit ac2adbb into main May 22, 2026
4 of 5 checks passed
@f-trycua
f-trycua deleted the fix/install-local-ps1-param-alignment-paths branch May 22, 2026 18:23
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ddaffdc8-e640-46cc-b00e-349317189937

📥 Commits

Reviewing files that changed from the base of the PR and between f8e56d6 and b880a66.

📒 Files selected for processing (1)
  • libs/cua-driver-rs/scripts/install-local.ps1

📝 Walkthrough

Walkthrough

The install-local.ps1 script is simplified to always build in release mode, adopts production-aligned install paths, removes the -Release parameter option, adds a new -NoPathUpdate switch to control whether the installed binary's bin directory is added to the user PATH, and implements logic to update both the current process and persistent user PATH environment variables.

Changes

Local installer script update

Layer / File(s) Summary
Parameter interface and documentation updates
libs/cua-driver-rs/scripts/install-local.ps1
Header comments and parameter signature updated to remove -Release flag and introduce -NoPathUpdate, reflecting the shift to unconditional release-mode builds and new PATH control capability.
Install paths alignment to production layout
libs/cua-driver-rs/scripts/install-local.ps1
Default VisibleBinDir set to Programs\Cua\cua-driver\bin and package home to .cua-driver to match post-v0.2.14 production installer scheme; build configuration variable hardcoded to release.
Build step simplification
libs/cua-driver-rs/scripts/install-local.ps1
Build invocation consolidated to always run cargo build --release, eliminating conditional debug-vs-release logic that was previously gated by the -Release parameter.
User and session PATH management
libs/cua-driver-rs/scripts/install-local.ps1
New PATH update block added: when -NoPathUpdate is not set, appends the visible bin directory to user PATH (if not already present) and prepends it to the current process $env:Path for immediate command availability in the same shell.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • trycua/cua#1652: Updates PowerShell installer to make cua-driver immediately resolvable by prepending the install bin directory to $env:Path, directly related to the PATH management feature added here.
  • trycua/cua#1644: Updates Windows installer path logic to use the new Cua\cua-driver layout (replacing legacy paths), aligning with the production-aligned paths adopted in this script update.
  • trycua/cua#1576: Adds -NoPathUpdate switch to install.ps1 to control PATH updates, implementing the same PATH control feature pattern now added to install-local.ps1.

Poem

🐰 A local script grows lean and true,
Release builds always—no switch to choose,
Paths now match production's careful view,
And PATH updates? Toggled to your use!
Junctions point to current, clean and clear,
The installer script—now streamlined here! 🎯

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/install-local-ps1-param-alignment-paths

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant