Skip to content

fix: Windows compatibility across postinstall, desktop, plugins, and scripts#211

Open
mynameistito wants to merge 2 commits intoRhysSullivan:mainfrom
mynameistito:fix/windows-compatibility
Open

fix: Windows compatibility across postinstall, desktop, plugins, and scripts#211
mynameistito wants to merge 2 commits intoRhysSullivan:mainfrom
mynameistito:fix/windows-compatibility

Conversation

@mynameistito
Copy link
Copy Markdown

@mynameistito mynameistito commented Apr 11, 2026

Fixes 10 Windows compatibility issues found by scanning the codebase. Each fix is targeted and minimal.

Issues fixed

apps/cli/src/build.ts (postinstall script)

Expand-Archive fails on Windows PowerShell 5.x (Fixes: #205)
powershell.exe fails to autoload Microsoft.PowerShell.Archive in some environments. Now tries pwsh (PowerShell 7) first and falls back to powershell.exe if it fails or isn't present.

platform === "win32" comparison always false (Fixes: #206)
platform is mapped through platformMap to "windows", but the legacy binary path check compared against "win32". The old .executor.exe binary was never cleaned up on Windows. Fixed to compare against "windows".

chmod called unconditionally on Windows (Fixes: #207)
fs.chmodSync(cachedBinary, 0o755) throws on Windows. Guarded with if (platform !== "windows").


packages/kernel/runtime-deno-subprocess/src/index.ts

Deno lookup uses HOME and no .exe (Fixes: #208)
HOME is typically unset on Windows; the correct var is USERPROFILE. Deno on Windows also installs to %USERPROFILE%\.deno\bin\deno.exe. Both fixed.

Worker script path resolution broken on Windows (Fixes: #210)
resolveWorkerScriptPath had a moduleUrl.startsWith("/") shortcut that silently broke on Windows, where import.meta.url is file:///C:/.... Removed the shortcut so all cases go through fileURLToPath.


packages/plugins/file-secrets/src/index.ts

Auth stored in ~/.local/share on Windows (Fixes: #209)
.local/share is an XDG/Linux convention. On Windows the correct location is %LOCALAPPDATA%. xdgDataHome() now branches on process.platform === "win32" and uses LOCALAPPDATA (falling back to APPDATA).


apps/desktop/src/main.ts

Desktop app skips PATH patching entirely on Windows (Fixes: #203)
After copying the CLI binary, the app returned early on win32 without touching PATH. Windows users had to update PATH manually. Now adds the bin dir to HKCU\Environment via reg add so new terminals pick it up automatically.

Scope path display breaks on Windows paths (Fixes: #204)
scopePath.split("/").pop() produces wrong results for Windows paths with backslashes. Fixed to use path.basename() with trailing separator stripped.


apps/local/src/web/shell.tsx

Path splitting uses / only (Fixes: #204)
name.split("/") in ScopeLabel breaks on Windows paths. Fixed to split on [/\].


package.json + scripts/clean.ts

clean script uses rm -rf and GNU find (Fixes: #201)
Neither works on Windows without WSL. Replaced with scripts/clean.ts, a small cross-platform Bun script that replicates the same directory removal logic using fs.rmSync.


apps/cloud/package.json

Deploy script uses sh -c (Fixes: #202)
sh isn't available on Windows. Replaced sh -c 'vite build && wrangler deploy' by running each command directly with op run.


Fixes: #196

Test Checklist

Postinstall (most important)

  • bun install -g executor completes without error on Windows (no Expand-Archive module load failure)
  • Verify it uses pwsh first: rename/remove pwsh.exe temporarily and confirm it falls back to powershell.exe cleanly
  • After install, confirm %APPDATA%\...\executor\runtime\executor.exe exists and is runnable

Clean script

  • bun run clean from repo root completes without error on Windows
  • node_modules, dist, .turbo are removed from root and all apps/+packages/ subdirs

File secrets path

  • Store a secret via the app, confirm auth.json is created under %LOCALAPPDATA%\executor\ not ~\.local\share\executor\

Deno subprocess runtime

  • With Deno installed via the standard installer, confirm the runtime resolves %USERPROFILE%\.deno\bin\deno.exe without needing DENO_BIN set manually
  • Confirm DENO_BIN override still works when set

Desktop PATH patching

  • Install via desktop app, open a new terminal, run executor — should be found on PATH without manual edits
  • Confirm reg query HKCU\Environment /v Path contains the executor bin dir after install
  • Re-installing should not duplicate the entry

Scope path display

  • Open a scope pointed at a Windows path like C:\Users\name\projects\myapp — label should show myapp, not a broken string
  • Works correctly for paths with trailing backslash

Cloud deploy (needs op + wrangler)

  • bun run deploy in apps/cloud no longer fails with sh: command not found
---

Identified and fixed with AI assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment