Skip to content

Commit 4a1ffe0

Browse files
Skip auto-update on unsupported Windows architectures (#4298)
While PowerShell now works on ARM64 Windows, it does not yet have an MSI installer, so for now instead of erroneously attempting to install the x64 version, we just recommend that the user update (like we do for Linux). Note that the string is now capitalized due to a server-side change that simply returns .NET's `System.Runtime.InteropServices.Architecture` enum as a string.
1 parent 6152c60 commit 4a1ffe0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/features/UpdatePowerShell.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { LanguageClient } from "vscode-languageclient/node";
1515
import { Logger } from "../logging";
1616
import { SessionManager } from "../session";
1717
import { changeSetting } from "../settings";
18-
import { isMacOS, isWindows } from "../utils";
18+
import { isLinux, isMacOS, isWindows } from "../utils";
1919
import { EvaluateRequestType } from "./Console";
2020

2121
const streamPipeline = util.promisify(stream.pipeline);
@@ -113,7 +113,8 @@ export async function InvokePowerShellUpdateCheck(
113113
}). The current latest release is ${release.version.raw
114114
}.`;
115115

116-
if (process.platform === "linux") {
116+
// Cannot auto-install for Linux or Windows that isn't x86 or x64.
117+
if (isLinux || (isWindows && (arch !== "X86" && arch !== "X64"))) {
117118
void logger.writeAndShowInformation(`${commonText} We recommend updating to the latest version.`);
118119
return;
119120
}
@@ -134,7 +135,7 @@ export async function InvokePowerShellUpdateCheck(
134135
// Yes choice.
135136
case 0:
136137
if (isWindows) {
137-
const msiMatcher = arch === "x86" ?
138+
const msiMatcher = arch === "X86" ?
138139
"win-x86.msi" : "win-x64.msi";
139140

140141
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)