From de5fd7b110d05ed2096713d5a0d5794dc5c6beb2 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 16:25:43 +0000 Subject: [PATCH 1/6] fix: don't show install.sh command on Windows Detect Windows users via navigator.platform and show appropriate installation instructions (GitHub releases + winget) instead of the Linux/macOS install.sh script. --- .../CliInstallPage/CliInstallPageView.tsx | 58 ++++++++++++++++--- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/site/src/pages/CliInstallPage/CliInstallPageView.tsx b/site/src/pages/CliInstallPage/CliInstallPageView.tsx index 0dc7240870759..a3b7515308779 100644 --- a/site/src/pages/CliInstallPage/CliInstallPageView.tsx +++ b/site/src/pages/CliInstallPage/CliInstallPageView.tsx @@ -9,20 +9,51 @@ type CliInstallPageViewProps = { }; export const CliInstallPageView: FC = ({ origin }) => { + const isWindows = navigator.platform.toLowerCase().includes("win"); + return (
Install the Coder CLI -

- Copy the command below and{" "} - paste it in your terminal. -

+ {isWindows ? ( + <> +

+ Download the CLI from{" "} + GitHub releases: +

+ + + +

+ Download the Windows installer (.msi) or standalone binary (.exe). +
+ Alternatively, use winget: +

- + + + ) : ( + <> +

+ Copy the command below and{" "} + paste it in your terminal. +

+ + + + )}
@@ -77,4 +108,13 @@ const styles = { color: theme.palette.text.secondary, marginTop: 24, }), + + windowsInstructions: (theme) => ({ + fontSize: 14, + color: theme.palette.text.secondary, + paddingTop: 16, + paddingBottom: 8, + textAlign: "center", + lineHeight: 1.4, + }), } satisfies Record>; From 251a3e9de1a666bf5ef92109a44ff61500d9e978 Mon Sep 17 00:00:00 2001 From: M Atif Ali Date: Fri, 31 Oct 2025 18:29:42 +0500 Subject: [PATCH 2/6] fix(cli,ui): hide curl install message on Windows; hide UI command on Windows (Chrome/Firefox compatible) --- cli/root.go | 4 +- .../CliInstallPage/CliInstallPageView.tsx | 37 +++++-------------- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/cli/root.go b/cli/root.go index c44c0625c2c34..2a5b7282d6d6e 100644 --- a/cli/root.go +++ b/cli/root.go @@ -1369,8 +1369,8 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In switch { case serverInfo.UpgradeMessage != "": upgradeMessage = serverInfo.UpgradeMessage - // The site-local `install.sh` was introduced in v2.19.0 - case serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0: + // The site-local `install.sh` was introduced in v2.19.0. Skip curl instruction on Windows. + case runtime.GOOS != "windows" && serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0: upgradeMessage = fmt.Sprintf("download %s with: 'curl -fsSL %s/install.sh | sh'", serverVersion, serverInfo.DashboardURL) } } diff --git a/site/src/pages/CliInstallPage/CliInstallPageView.tsx b/site/src/pages/CliInstallPage/CliInstallPageView.tsx index a3b7515308779..ed78541510192 100644 --- a/site/src/pages/CliInstallPage/CliInstallPageView.tsx +++ b/site/src/pages/CliInstallPage/CliInstallPageView.tsx @@ -9,42 +9,25 @@ type CliInstallPageViewProps = { }; export const CliInstallPageView: FC = ({ origin }) => { - const isWindows = navigator.platform.toLowerCase().includes("win"); - + const isWindows = + typeof navigator !== "undefined" && /windows/i.test(navigator.userAgent); return (
Install the Coder CLI {isWindows ? ( - <> -

- Download the CLI from{" "} - GitHub releases: -

- - - -

- Download the Windows installer (.msi) or standalone binary (.exe). -
- Alternatively, use winget: -

- - - +

+ This installer is for macOS and Linux. On Windows, please use the MSI + installer or winget. See{" "} + docs. +

) : ( <>

Copy the command below and{" "} - paste it in your terminal. + + paste it in your terminal. +

Date: Fri, 31 Oct 2025 18:33:18 +0500 Subject: [PATCH 3/6] fix(cli,ui): fully hide install instructions on Windows (no docs link, no CLI upgrade message) --- cli/root.go | 5 ++++- site/src/pages/CliInstallPage/CliInstallPageView.tsx | 12 ++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cli/root.go b/cli/root.go index 2a5b7282d6d6e..6d9589123bb4c 100644 --- a/cli/root.go +++ b/cli/root.go @@ -1323,7 +1323,7 @@ func defaultUpgradeMessage(version string) string { // to the GitHub release page to download the latest installer. version = strings.TrimPrefix(version, "v") if runtime.GOOS == "windows" { - return fmt.Sprintf("download the server version from: https://github.com/coder/coder/releases/v%s", version) + return "" } return fmt.Sprintf("download the server version with: 'curl -L https://coder.com/install.sh | sh -s -- --version %s'", version) } @@ -1373,6 +1373,9 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In case runtime.GOOS != "windows" && serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0: upgradeMessage = fmt.Sprintf("download %s with: 'curl -fsSL %s/install.sh | sh'", serverVersion, serverInfo.DashboardURL) } + if runtime.GOOS == "windows" { + upgradeMessage = "" + } } fmtWarningText := "version mismatch: client %s, server %s\n%s" fmtWarn := pretty.Sprint(cliui.DefaultStyles.Warn, fmtWarningText) diff --git a/site/src/pages/CliInstallPage/CliInstallPageView.tsx b/site/src/pages/CliInstallPage/CliInstallPageView.tsx index ed78541510192..1e869ea54e82e 100644 --- a/site/src/pages/CliInstallPage/CliInstallPageView.tsx +++ b/site/src/pages/CliInstallPage/CliInstallPageView.tsx @@ -15,19 +15,11 @@ export const CliInstallPageView: FC = ({ origin }) => {
Install the Coder CLI - {isWindows ? ( -

- This installer is for macOS and Linux. On Windows, please use the MSI - installer or winget. See{" "} - docs. -

- ) : ( + {!isWindows && ( <>

Copy the command below and{" "} - - paste it in your terminal. - + paste it in your terminal.

Date: Fri, 31 Oct 2025 13:37:22 +0000 Subject: [PATCH 4/6] fix: apply biome formatting to strong tag --- site/src/pages/CliInstallPage/CliInstallPageView.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/src/pages/CliInstallPage/CliInstallPageView.tsx b/site/src/pages/CliInstallPage/CliInstallPageView.tsx index 1e869ea54e82e..f92ca98479015 100644 --- a/site/src/pages/CliInstallPage/CliInstallPageView.tsx +++ b/site/src/pages/CliInstallPage/CliInstallPageView.tsx @@ -19,7 +19,9 @@ export const CliInstallPageView: FC = ({ origin }) => { <>

Copy the command below and{" "} - paste it in your terminal. + + paste it in your terminal. +

Date: Fri, 31 Oct 2025 13:46:14 +0000 Subject: [PATCH 5/6] fix: preserve custom upgrade messages on Windows --- cli/root.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/cli/root.go b/cli/root.go index 6d9589123bb4c..096a22a5d9cd4 100644 --- a/cli/root.go +++ b/cli/root.go @@ -1373,9 +1373,6 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In case runtime.GOOS != "windows" && serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0: upgradeMessage = fmt.Sprintf("download %s with: 'curl -fsSL %s/install.sh | sh'", serverVersion, serverInfo.DashboardURL) } - if runtime.GOOS == "windows" { - upgradeMessage = "" - } } fmtWarningText := "version mismatch: client %s, server %s\n%s" fmtWarn := pretty.Sprint(cliui.DefaultStyles.Warn, fmtWarningText) From 89d38749048bd9a25448de75f47ddf2aa5963d77 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Mon, 3 Nov 2025 13:59:07 +0500 Subject: [PATCH 6/6] Discard changes to site/src/pages/CliInstallPage/CliInstallPageView.tsx --- .../CliInstallPage/CliInstallPageView.tsx | 35 +++++-------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/site/src/pages/CliInstallPage/CliInstallPageView.tsx b/site/src/pages/CliInstallPage/CliInstallPageView.tsx index f92ca98479015..0dc7240870759 100644 --- a/site/src/pages/CliInstallPage/CliInstallPageView.tsx +++ b/site/src/pages/CliInstallPage/CliInstallPageView.tsx @@ -9,28 +9,20 @@ type CliInstallPageViewProps = { }; export const CliInstallPageView: FC = ({ origin }) => { - const isWindows = - typeof navigator !== "undefined" && /windows/i.test(navigator.userAgent); return (
Install the Coder CLI - {!isWindows && ( - <> -

- Copy the command below and{" "} - - paste it in your terminal. - -

+

+ Copy the command below and{" "} + paste it in your terminal. +

- - - )} +
@@ -85,13 +77,4 @@ const styles = { color: theme.palette.text.secondary, marginTop: 24, }), - - windowsInstructions: (theme) => ({ - fontSize: 14, - color: theme.palette.text.secondary, - paddingTop: 16, - paddingBottom: 8, - textAlign: "center", - lineHeight: 1.4, - }), } satisfies Record>;