Add a windows launcher to the standalone release - #7984
Open
denusklo wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.