Skip to content

Desktop: Remove POSIX dependencies from snapshots and runtime - #404

Merged
priethor merged 9 commits into
mainfrom
priethor/add/windows-app
Jul 29, 2026
Merged

Desktop: Remove POSIX dependencies from snapshots and runtime#404
priethor merged 9 commits into
mainfrom
priethor/add/windows-app

Conversation

@priethor

@priethor priethor commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What

This is the first app-side PR for Windows support. It replaces zip, unzip, and which with JavaScript helpers, adds Windows-aware executable lookup, and makes site extraction and runtime shutdown asynchronous.

The site refresh keeps the existing database, uploads, and wp-config.php. There's no Windows runtime or installer here yet, and this PR doesn't touch Buildkite or signing.

Why

Most of the desktop app still assumes macOS or Linux paths, tools, and process signals. We need to remove those assumptions before the Windows build can start and shut down cleanly.

How

Cortext now checks ZIP entries before extraction and only moves a site into place once the extraction has finished. On Windows, PHP uses php.exe, runs as one hidden worker without POSIX process groups, and falls back to taskkill if it doesn't exit normally.

The app also waits for PHP to stop before quitting or applying an update.

Only one copy runs at a time. Opening Cortext again brings the existing window to the front instead of starting a second app against the same site folder.

Testing Instructions

  1. Rebuild snapshot.zip from apps/desktop.
  2. Launch Cortext and confirm that an existing workspace opens normally.
  3. Make a change, quit Cortext, and reopen it to confirm the change is still there.
  4. Close Cortext once while it is loading and once after it has loaded. Wait for it to quit fully, then reopen it and confirm it starts both times without a port 9402 error.
  5. With Cortext already open, launch it again from Finder or the dock. Confirm that no second window opens and the existing one comes to the front.

@priethor priethor added area: desktop Desktop app, PHP runtime, snapshots, and desktop packaging. type: enhancement Improvement to existing behavior. labels Jul 28, 2026
@priethor priethor self-assigned this Jul 28, 2026
@priethor
priethor marked this pull request as ready for review July 28, 2026 22:40
@priethor
priethor merged commit 5a8e912 into main Jul 29, 2026
14 checks passed
@priethor
priethor deleted the priethor/add/windows-app branch July 29, 2026 09:41
@github-actions github-actions Bot added this to the 0.2.0 milestone Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: desktop Desktop app, PHP runtime, snapshots, and desktop packaging. type: enhancement Improvement to existing behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant