Skip to content

Commit 251a3e9

Browse files
committed
fix(cli,ui): hide curl install message on Windows; hide UI command on Windows (Chrome/Firefox compatible)
1 parent de5fd7b commit 251a3e9

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

cli/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,8 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In
13691369
switch {
13701370
case serverInfo.UpgradeMessage != "":
13711371
upgradeMessage = serverInfo.UpgradeMessage
1372-
// The site-local `install.sh` was introduced in v2.19.0
1373-
case serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0:
1372+
// The site-local `install.sh` was introduced in v2.19.0. Skip curl instruction on Windows.
1373+
case runtime.GOOS != "windows" && serverInfo.DashboardURL != "" && semver.Compare(semver.MajorMinor(serverVersion), "v2.19") >= 0:
13741374
upgradeMessage = fmt.Sprintf("download %s with: 'curl -fsSL %s/install.sh | sh'", serverVersion, serverInfo.DashboardURL)
13751375
}
13761376
}

site/src/pages/CliInstallPage/CliInstallPageView.tsx

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,25 @@ type CliInstallPageViewProps = {
99
};
1010

1111
export const CliInstallPageView: FC<CliInstallPageViewProps> = ({ origin }) => {
12-
const isWindows = navigator.platform.toLowerCase().includes("win");
13-
12+
const isWindows =
13+
typeof navigator !== "undefined" && /windows/i.test(navigator.userAgent);
1414
return (
1515
<div css={styles.container}>
1616
<Welcome>Install the Coder CLI</Welcome>
1717

1818
{isWindows ? (
19-
<>
20-
<p css={styles.instructions}>
21-
Download the CLI from{" "}
22-
<strong css={{ display: "block" }}>GitHub releases:</strong>
23-
</p>
24-
25-
<CodeExample
26-
css={{ maxWidth: "100%" }}
27-
code="https://github.com/coder/coder/releases"
28-
secret={false}
29-
/>
30-
31-
<p css={styles.windowsInstructions}>
32-
Download the Windows installer (.msi) or standalone binary (.exe).
33-
<br />
34-
Alternatively, use winget:
35-
</p>
36-
37-
<CodeExample
38-
css={{ maxWidth: "100%" }}
39-
code="winget install Coder.Coder"
40-
secret={false}
41-
/>
42-
</>
19+
<p css={styles.instructions}>
20+
This installer is for macOS and Linux. On Windows, please use the MSI
21+
installer or winget. See{" "}
22+
<RouterLink to="/docs/install/cli">docs</RouterLink>.
23+
</p>
4324
) : (
4425
<>
4526
<p css={styles.instructions}>
4627
Copy the command below and{" "}
47-
<strong css={{ display: "block" }}>paste it in your terminal.</strong>
28+
<strong css={{ display: "block" }}>
29+
paste it in your terminal.
30+
</strong>
4831
</p>
4932

5033
<CodeExample

0 commit comments

Comments
 (0)