Skip to content

feat(windows): native host and desktop installer - #1426

Open
JohnC0de wants to merge 9 commits into
get-bb:mainfrom
JohnC0de:feat/windows-native-desktop
Open

feat(windows): native host and desktop installer#1426
JohnC0de wants to merge 9 commits into
get-bb:mainfrom
JohnC0de:feat/windows-native-desktop

Conversation

@JohnC0de

@JohnC0de JohnC0de commented Aug 12, 2026

Copy link
Copy Markdown

Hey, hi! This is my attempt on making bb work on windows, i really tried to make things as clean/reviewed as possible, but its still ai generated; Im happy to help in any changes necessary;

I tried to cover properly the CLI, App with electron and the NSIS installation for the .exe

The product-level native Windows 11 program, including the design and
verification plan this PR is a first cut of, is #1206 by Rodion Mostovoi
(@rodion-m).

----- FROM HERE DOWNWARDS ITS AI SLOP -----

Why

Native Windows still has to go through WSL2 today. The product rejects C:\
project paths, bb-app will not install on win32, and the desktop package
was os: darwin only. This is a slice toward Rodion's #1206, not the full
proposal (no signing, no Windows CI, no published latest.yml).

Per CONTRIBUTING this would normally wait for issue sign-off. Opening it so
the concrete diff is easy to evaluate, same approach as #1392.

What changed

Host. win32 is a HostPlatform (protocol 124; main is 123).
Project paths accept drive-letter and UNC input. Process stop uses
taskkill /T. Worktree setup hooks run through Git's bundled bash when
sh is missing. Terminals use ConPTY. Provider CLI lookup honors PATHEXT.
apps/cli/bin/bb.cmd sits next to the Unix bb script.

Launch. One BbCliLaunchSpec: Node always spawns process.execPath plus
the JS entry. bb.cmd is only the PATHEXT / agent-shell path. Reexec and the
launcher never spawn a .cmd.

Plugins. Manifest containment used rootDir + "/", so ./src/server.ts
looked like an escape on Windows. It now uses path.relative.

Desktop. @bb/desktop installs on win32. dist:win writes an NSIS
installer (bb-<version>-x64.exe), per-user, with a Start Menu and desktop
shortcut. package:win only emits release/win-unpacked/bb.exe for local
smoke. afterPack fetches Electron-ABI better-sqlite3 and copies
@parcel/watcher-win32-x64. The log viewer tails incrementally (bytesRead

  • split UTF-8 suffix). Owned-runtime stop kills the process tree. Auto-update
    and the JSON version feed stay darwin-only. There is no Windows feed yet.

Docs. README, docs/platform-support.md, docs/worktrees.md, and the
bb-app README describe the source-checkout path. Published download assets
remain macOS Apple Silicon. plans/windows-native.md is this cut;
plans/windows-native-later.md is the rest of #1206.

Intentionally deferred

Same spirit as #1392. See plans/windows-native-later.md.

  1. Authenticode / SmartScreen
  2. windows-latest CI and packaged E2E
  3. Publishing Windows artifacts and latest.yml
  4. pathKey / daemon-owned paths, registry PATH, .bb-env-setup.ps1
  5. The rest of the Proposal: First-class native Windows 11 support for bb and bb Desktop #1206 definition of done

License / contributing

MIT. No CLA. Rebased onto current main (protocol 124). Happy to restack.

AGENT GENERATED: by Grok 4.6

@JohnC0de
JohnC0de force-pushed the feat/windows-native-desktop branch from 232c866 to c94ebed Compare August 12, 2026 22:44
@JohnC0de

Copy link
Copy Markdown
Author

First PR from this fork, so the two Actions workflows are waiting on a maintainer approval (CI + version lockstep). The branch is conflict-free with main.

If someone on the team can approve those runs, the required Ubuntu checks should start. Happy to rebase if #1392 lands first.

AGENT GENERATED: by Grok 4.6

@JohnC0de
JohnC0de force-pushed the feat/windows-native-desktop branch from c94ebed to 73747cb Compare August 13, 2026 00:17
@JohnC0de JohnC0de changed the title feat(windows): native host and desktop unpack feat(windows): native host and desktop installer Aug 13, 2026
@JohnC0de

Copy link
Copy Markdown
Author

Rebased onto current main (protocol 113; main is 112) and switched the Windows desktop target from portable unpack to an NSIS installer.

Build it with pnpm --filter @bb/desktop run dist:win. package:win is still the unpacked smoke path.

First-fork Actions still need a maintainer approval before the required Ubuntu checks can start.

AGENT GENERATED: by Grok 4.6

@rodion-m

rodion-m commented Aug 14, 2026

Copy link
Copy Markdown

Why not the entire #1206 ? :) There is a detailed plan and even verification plan.

Treat win32 as a first-class host. Project paths accept C:\ and UNC. Protocol 113 carries the platform. Process stop, Git setup hooks, ConPTY, PATHEXT CLI lookup, and bb.cmd follow.
Use path.relative so a relative bb.server entry stays inside the plugin directory on win32. The server manifest uses the same helper.
Unlock @bb/desktop on win32. electron-builder emits win-unpacked/bb.exe, afterPack fetches Electron-ABI natives and the parcel watcher prebuild, and the log viewer plus owned-runtime stop work without POSIX tail or SIGTERM cascade.
Auto-update and the JSON version feed stay darwin-only because there is no Windows latest.yml. Docs call native Windows a source-checkout path, not a published support claim.
electron-builder target is nsis. dist:win writes bb-<version>-x64.exe as a per-user wizard with Start Menu and desktop shortcuts. package:win stays the unpacked smoke path.
One launch spec so Node never spawns .cmd. Protocol 124 carries win32.
Drive-letter preview, lexical containment, Explorer folder-open, and
windowsHide/log-tail leftovers from the first-cut plan.
@JohnC0de
JohnC0de force-pushed the feat/windows-native-desktop branch from 73747cb to 8997e2a Compare August 15, 2026 15:01
GUI shortcuts inherit a stripped PATH. Read HKLM then HKCU Path
instead of spawning pwsh, matching Explorer's environment block.
@JohnC0de

Copy link
Copy Markdown
Author

Why not the entire #1206 ? :) There is a detailed plan and even verification plan.

Fair question. When I opened this I hadn't planned to take on all of #1206. It started as "make a Win11 checkout actually run" (host, C:\ paths, ConPTY, unsigned NSIS).

After your comment I went back through the design and verification attachments and treated them as the program. This PR is now written as a first cut of that, same shape as #1392. The rest is listed in plans/windows-native-later.md so it stays on your roadmap instead of a second one.

A few #1206 items I can't finish from here even if I wanted to: Authenticode / SmartScreen, a latest.yml Windows feed, required windows-latest CI, and the verification pass with WSL actually disabled. Those need signing secrets, a blessed runner, and a clean machine.

What I could do here is already in the branch. Happy to take the next slice from #1206 after this lands, or pull something forward if you want it in this PR!

signAndEditExecutable: false skipped rcedit, so bb.exe kept Electron's
icon and FileDescription. Raycast and Start Menu then showed the atom.
Flip the flag so electron-builder stamps icon.ico. Signing still no-ops
without a cert.
Pin signAndEditExecutable to true in the config contract. Windows-only
electron-builder runs drop CSC_LINK and CSC_KEY_PASSWORD so a macOS p12
cannot reach Authenticode. WIN_CSC_LINK still signs Windows when set.
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.

2 participants