Skip to content

feat(windows): run the app on Windows - #11

Open
madeline-yana wants to merge 1 commit into
bytesbay:mainfrom
madeline-yana:platform/windows
Open

madeline-yana wants to merge 1 commit into
bytesbay:mainfrom
madeline-yana:platform/windows

Conversation

@madeline-yana

Copy link
Copy Markdown
  • platform glue for %APPDATA%/%LOCALAPPDATA% paths, the Recycle Bin, revealing files in Explorer, opening the editor, clipboard file lists, process liveness and DST-correct local timestamps
  • one app per user through a named pipe; a second launch hands over its folder or pi-gpui:// link
  • pi discovery through PATHEXT (npm's pi.cmd, not the extensionless Unix script), started through cmd /d /c with no console window
  • pi auth login runs in a ConPTY, the Windows pseudo-terminal
  • the updater unpacks the release zip and swaps the app folder from a detached PowerShell after the running .exe exits
  • git, curl, pi and plugins run without flashing console windows; stopping a cmd /c pi.cmd child uses taskkill /T so node is not orphaned
  • the title bar draws its own minimize, maximize and close buttons, drags the window itself, and Alt+F4 quits
  • script/bundle-windows.ps1 builds pi-gpui.app/ and the release zip; a separate CI workflow tests and packages Windows
  • the release workflow gains a Windows job next to the Linux ones; no existing job is restructured, so this merges independently
  • README, CONTRIBUTING and AGENTS describe the Windows build

- platform glue for %APPDATA%/%LOCALAPPDATA% paths, the Recycle Bin,
  revealing files in Explorer, opening the editor, clipboard file lists,
  process liveness and DST-correct local timestamps
- one app per user through a named pipe; a second launch hands over its
  folder or pi-gpui:// link
- pi discovery through PATHEXT (npm's pi.cmd, not the extensionless Unix
  script), started through cmd /d /c with no console window
- pi auth login runs in a ConPTY, the Windows pseudo-terminal
- the updater unpacks the release zip and swaps the app folder from a
  detached PowerShell after the running .exe exits
- git, curl, pi and plugins run without flashing console windows;
  stopping a cmd /c pi.cmd child uses taskkill /T so node is not orphaned
- the title bar draws its own minimize, maximize and close buttons, drags
  the window itself, and Alt+F4 quits
- script/bundle-windows.ps1 builds pi-gpui.app/ and the release zip;
  a separate CI workflow tests and packages Windows
- the release workflow gains a Windows job next to the Linux ones; no
  existing job is restructured, so this merges independently
- README, CONTRIBUTING and AGENTS describe the Windows build
@madeline-yana

Copy link
Copy Markdown
Author

Run the app on Windows

What

Windows x86_64 support. The app itself is portable Rust + GPUI; what was
missing is the platform glue and packaging.

  • Platform glue (src/platform.rs): %APPDATA%/%LOCALAPPDATA% paths,
    Recycle Bin, reveal in Explorer, open in Zed/associated app, clipboard file
    lists (CF_HDROP), process liveness, and DST-correct local timestamps.
  • One app per user (src/single_instance.rs): a per-user named pipe; a
    second launch forwards its folder or pi-gpui:// link and exits.
  • pi discovery: PATHEXT-aware lookup (npm installs pi.cmd next to an
    extensionless Unix pi), started through cmd /d /c with no console
    window, so pi needs no login shell on Windows.
  • Provider login: src/pty.rs now holds the existing Unix pty (moved out
    of pi_auth.rs) and a ConPTY implementation for Windows, so
    pi auth login still asks its questions.
  • Updater: Windows assets are
    pi-gpui-<version>-windows-<arch>.zip; tar (bsdtar) unpacks them, the
    new binary is version-checked, and the folder swap runs from a detached
    PowerShell after the running .exe exits (Windows locks it), then
    relaunches.
  • Quiet children: git, curl, pi and plugins run without console
    windows; stopping a cmd /c pi.cmd child uses taskkill /T so node is not
    orphaned.
  • Window chrome: GPUI 0.2.2 always hides the native title bar on Windows
    and reports server-side decorations, so the app draws minimize/maximize/
    close itself, starts the drag with WM_NCLBUTTONDOWN/HTCAPTION (no
    WindowControlArea::Drag, which would swallow the buttons), and binds
    Alt+F4.
  • Packaging: script/bundle-windows.ps1 writes pi-gpui.app/ and
    pi-gpui-<version>-windows-<arch>.zip, with plugins and licenses like the
    Linux tarball.
  • CI: a separate ci-windows.yml tests, clippys and packages Windows.
  • Release: a windows job, needs: macos, uploads the zip next to the
    Linux assets. No existing job is restructured.

Testing

On Windows 10 22H2 x86_64 with Rust 1.90 (GNU toolchain locally; CI uses
MSVC):

  • cargo fmt --all -- --check
  • cargo test --locked — 81 passed
  • cargo clippy --all-targets --locked — no warnings
  • cargo build --locked, then the app starts, opens a window and discovers
    pi 1.7.0 at …\.pi\agent\bin\pi.CMD

The branch also merges cleanly with the Intel Mac branch (octopus merge, no
conflicts).

Known gaps (good follow-ups, not blockers)

  • Windows builds are unsigned: SmartScreen warns once. There is no installer
    yet, so the pi-gpui:// protocol is not registered and there is no Start
    menu/Add or Remove Programs entry.
  • No Windows .ico/window icon yet.
  • Recycle Bin goes through PowerShell's Microsoft.VisualBasic API; a direct
    IFileOperation/SHFileOperationW call would avoid the child process.
  • The update swap script is PowerShell; a small helper binary using job
    objects would be more robust.
  • Only startup was exercised on Windows, not a full click-through of every
    panel.

Notes for the reviewer

  • Cargo.lock only lists the already-present windows 0.61.3 under pi-gpui;
    no new crates, no lockfile churn.
  • src/pty.rs is a straight move of the Unix pty plus ConPTY;
    pi_auth.rs drops its Unix-only imports.
  • The Windows release job is additive (needs: macos, upload to the release
    the arm64 job creates), so this and the Intel Mac PR can merge in either
    order.

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