Skip to content

Add a windows launcher to the standalone release - #7984

Open
denusklo wants to merge 1 commit into
coder:mainfrom
denusklo:windows-release-launcher
Open

Add a windows launcher to the standalone release#7984
denusklo wants to merge 1 commit into
coder:mainfrom
denusklo:windows-release-launcher

Conversation

@denusklo

@denusklo denusklo commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The standalone release ships bin/code-server, a shell script that resolves
its own location and execs the bundled node against the release root. Windows
cannot run it, so a windows release arrives with no way to start it that does
not involve knowing where node ended up and typing both paths.

This adds the same launcher as a .cmd, copied into bin/ only when OS is
windows, so no other release changes at all. It is deliberately the shortest
thing that works: %~dp0 gives the bin directory, the root is one above it, and
the bundled node is handed the root and every argument.

Verified against a real windows release tree: --version answers, it works from
any working directory, and a bad flag comes back as exit code 1.

Two things a reviewer should know. The shell launcher resolves symlinks
before computing the root, because of #1537; the .cmd does not, since %~dp0
reports the directory of the link rather than of the target and batch has no
readlink. A copy of the file works anywhere, a symlink to it does not.

And the file is checked in with CRLF, which is what a .cmd is expected to have
on the platform it runs on and what a windows checkout would produce for it
anyway.

The standalone release ships bin/code-server, a shell script that resolves
its own location and execs the bundled node against the release root. Windows
cannot run it, so a windows release arrives with no way to start it that does
not involve knowing where node ended up and typing both paths.

This adds the same launcher as a .cmd, copied into bin/ only when OS is
windows, so no other release changes at all. It is deliberately the shortest
thing that works: %~dp0 gives the bin directory, the root is one above it, and
the bundled node is handed the root and every argument.

Verified against a real windows release tree: --version answers, it works from
any working directory, and a bad flag comes back as exit code 1.

Two things a reviewer should know. The shell launcher resolves symlinks
before computing the root, because of coder#1537; the .cmd does not, since %~dp0
reports the directory of the link rather than of the target and batch has no
readlink. A copy of the file works anywhere, a symlink to it does not.

And the file is checked in with CRLF, which is what a .cmd is expected to have
on the platform it runs on and what a windows checkout would produce for it
anyway.
@denusklo
denusklo requested a review from a team as a code owner September 5, 2026 09:22
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