From 9a7fa210284e3f183a08738eb44c23cb52457466 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 5 Nov 2020 19:09:49 -0800 Subject: [PATCH 1/4] Update cpptools.json (#6452) * Update cpptools.json --- Extension/cpptools.json | 2 +- Extension/src/abTesting.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Extension/cpptools.json b/Extension/cpptools.json index cd2a444e52..af505dc67c 100644 --- a/Extension/cpptools.json +++ b/Extension/cpptools.json @@ -4,5 +4,5 @@ "recursiveIncludes": 100, "gotoDefIntelliSense": 100, "enhancedColorization": 100, - "minimumVSCodeVersion": "1.44.0" + "minimumVSCodeVersion": "1.49.0" } \ No newline at end of file diff --git a/Extension/src/abTesting.ts b/Extension/src/abTesting.ts index cd0178a2ba..95052c8dc8 100644 --- a/Extension/src/abTesting.ts +++ b/Extension/src/abTesting.ts @@ -103,6 +103,7 @@ export class ABTestSettings { let hasError: boolean = false; const telemetryProperties: { [key: string]: string } = {}; const localConfigPath: string = util.getExtensionFilePath(localConfigFile); + // Download the latest cpptools.json. return util.downloadFileToDestination("https://go.microsoft.com/fwlink/?linkid=2097702", localConfigPath) .catch((error) => { // More specific error info is not likely to be helpful, and we get detailed download data from the initial install. From 890dae3a87e61c745e2458353398411786d155f0 Mon Sep 17 00:00:00 2001 From: csigs Date: Fri, 6 Nov 2020 11:30:56 -0800 Subject: [PATCH 2/4] Localization - Translated Strings (#6455) --- Extension/i18n/chs/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/csy/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/plk/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/ptb/src/Debugger/extension.i18n.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Extension/i18n/chs/src/Debugger/extension.i18n.json b/Extension/i18n/chs/src/Debugger/extension.i18n.json index 4d44be953a..efa67df6e7 100644 --- a/Extension/i18n/chs/src/Debugger/extension.i18n.json +++ b/Extension/i18n/chs/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "生成和调试活动文件", "cannot.build.non.cpp": "无法生成和调试,因为活动文件不是 C 或 C++ 源文件。", "no.compiler.found": "未找到编译程序", - "select.configuration": "Select a configuration", + "select.configuration": "选择配置", "cl.exe.not.available": "仅当从 VS 开发人员命令提示符处运行 VS Code 时,{0} 生成和调试才可用。" } \ No newline at end of file diff --git a/Extension/i18n/csy/src/Debugger/extension.i18n.json b/Extension/i18n/csy/src/Debugger/extension.i18n.json index cdec78bcb3..63e4fa11fe 100644 --- a/Extension/i18n/csy/src/Debugger/extension.i18n.json +++ b/Extension/i18n/csy/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Sestavit a ladit aktivní soubor", "cannot.build.non.cpp": "Sestavení a ladění není možné, protože aktivní soubor není zdrojový soubor jazyka C ani C++.", "no.compiler.found": "Nenašel se žádný kompilátor.", - "select.configuration": "Select a configuration", + "select.configuration": "Vybrat konfiguraci", "cl.exe.not.available": "Sestavení a ladění {0} je k dispozici jen v případě, že se nástroj VS Code spustil z nástroje Developer Command Prompt pro VS." } \ No newline at end of file diff --git a/Extension/i18n/plk/src/Debugger/extension.i18n.json b/Extension/i18n/plk/src/Debugger/extension.i18n.json index 77d5785781..5ed4522251 100644 --- a/Extension/i18n/plk/src/Debugger/extension.i18n.json +++ b/Extension/i18n/plk/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Kompiluj i debuguj aktywny plik", "cannot.build.non.cpp": "Nie można skompilować i debugować, ponieważ aktywny plik nie jest plikiem źródłowym języka C lub C++.", "no.compiler.found": "Nie znaleziono kompilatora", - "select.configuration": "Select a configuration", + "select.configuration": "Wybierz konfigurację", "cl.exe.not.available": "{0} — funkcji kompilacji i debugowania można używać tylko wtedy, gdy program VS Code został uruchomiony z wiersza polecenia dla deweloperów w programie VS." } \ No newline at end of file diff --git a/Extension/i18n/ptb/src/Debugger/extension.i18n.json b/Extension/i18n/ptb/src/Debugger/extension.i18n.json index de9f825614..d84fd86bbc 100644 --- a/Extension/i18n/ptb/src/Debugger/extension.i18n.json +++ b/Extension/i18n/ptb/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Criar e depurar o arquivo ativo", "cannot.build.non.cpp": "Não é possível criar e depurar porque o arquivo ativo não é um arquivo de origem C ou C++.", "no.compiler.found": "Nenhum compilador encontrado", - "select.configuration": "Select a configuration", + "select.configuration": "Selecionar uma configuração", "cl.exe.not.available": "A criação e a depuração de {0} só podem ser usadas quando o VS Code é executado por meio do Prompt de Comando do Desenvolvedor para VS." } \ No newline at end of file From 6867272d06b7c0a46d24752b35dfb4800430cd56 Mon Sep 17 00:00:00 2001 From: csigs Date: Mon, 9 Nov 2020 09:50:26 -0800 Subject: [PATCH 3/4] Localization - Translated Strings (#6477) Co-authored-by: azure-pipelines[bot] --- Extension/i18n/cht/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/deu/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/esn/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/fra/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/ita/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/jpn/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/kor/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/rus/src/Debugger/extension.i18n.json | 2 +- Extension/i18n/trk/src/Debugger/extension.i18n.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Extension/i18n/cht/src/Debugger/extension.i18n.json b/Extension/i18n/cht/src/Debugger/extension.i18n.json index 0427ee1480..e487153a80 100644 --- a/Extension/i18n/cht/src/Debugger/extension.i18n.json +++ b/Extension/i18n/cht/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "建置及偵錯使用中的檔案", "cannot.build.non.cpp": "因為作用中的檔案不是 C 或 C++ 來源檔案,所以無法建立和偵錯。", "no.compiler.found": "找不到任何編譯器", - "select.configuration": "Select a configuration", + "select.configuration": "選取組態", "cl.exe.not.available": "只有從 VS 的開發人員命令提示字元執行 VS Code 時,才可使用 {0} 組建和偵錯。" } \ No newline at end of file diff --git a/Extension/i18n/deu/src/Debugger/extension.i18n.json b/Extension/i18n/deu/src/Debugger/extension.i18n.json index c46eba6058..5a4b42ae53 100644 --- a/Extension/i18n/deu/src/Debugger/extension.i18n.json +++ b/Extension/i18n/deu/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Aktive Datei erstellen und debuggen", "cannot.build.non.cpp": "Erstellen und Debuggen nicht möglich, da die aktive Datei keine C- oder C++-Quelldatei ist.", "no.compiler.found": "Kein Compiler gefunden.", - "select.configuration": "Select a configuration", + "select.configuration": "Konfiguration auswählen", "cl.exe.not.available": "{0}-Build und -Debuggen können nur verwendet werden, wenn VS Code von der Developer-Eingabeaufforderung für VS ausgeführt wird." } \ No newline at end of file diff --git a/Extension/i18n/esn/src/Debugger/extension.i18n.json b/Extension/i18n/esn/src/Debugger/extension.i18n.json index 2dc6406ae4..18167003f5 100644 --- a/Extension/i18n/esn/src/Debugger/extension.i18n.json +++ b/Extension/i18n/esn/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Compilar y depurar el archivo activo", "cannot.build.non.cpp": "No se puede compilar y depurar código porque el archivo activo no es un archivo de código fuente de C o C++.", "no.compiler.found": "No se encontró ningún compilador", - "select.configuration": "Select a configuration", + "select.configuration": "Seleccionar una configuración", "cl.exe.not.available": "La compilación y depuración de {0} solo se puede usar cuando VS Code se ejecuta desde el Símbolo del sistema para desarrolladores de Visual Studio." } \ No newline at end of file diff --git a/Extension/i18n/fra/src/Debugger/extension.i18n.json b/Extension/i18n/fra/src/Debugger/extension.i18n.json index e56ce0eae7..84f02315cc 100644 --- a/Extension/i18n/fra/src/Debugger/extension.i18n.json +++ b/Extension/i18n/fra/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Générer et déboguer le fichier actif", "cannot.build.non.cpp": "Génération et débogage impossibles, car le fichier actif n'est pas un fichier source C ou C++.", "no.compiler.found": "Aucun compilateur", - "select.configuration": "Select a configuration", + "select.configuration": "Sélectionner une configuration", "cl.exe.not.available": "La génération et le débogage de {0} peuvent être utilisés uniquement quand VS Code est exécuté à partir de l'invite de commandes développeur pour VS." } \ No newline at end of file diff --git a/Extension/i18n/ita/src/Debugger/extension.i18n.json b/Extension/i18n/ita/src/Debugger/extension.i18n.json index 7b390565c9..5c6469cf60 100644 --- a/Extension/i18n/ita/src/Debugger/extension.i18n.json +++ b/Extension/i18n/ita/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Compila ed esegui il debug del file attivo", "cannot.build.non.cpp": "Non è possibile compilare ed eseguire il debug perché il file attivo non è un file di origine C o C++.", "no.compiler.found": "Non è stato trovato alcun compilatore", - "select.configuration": "Select a configuration", + "select.configuration": "Seleziona una configurazione", "cl.exe.not.available": "La compilazione e il debug di {0} sono utilizzabili solo quando VS Code viene eseguito da Prompt dei comandi per gli sviluppatori per Visual Studio." } \ No newline at end of file diff --git a/Extension/i18n/jpn/src/Debugger/extension.i18n.json b/Extension/i18n/jpn/src/Debugger/extension.i18n.json index cbd53303e6..19dce8f922 100644 --- a/Extension/i18n/jpn/src/Debugger/extension.i18n.json +++ b/Extension/i18n/jpn/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "アクティブ ファイルのビルドとデバッグ", "cannot.build.non.cpp": "アクティブ ファイルが C または C++ ソース ファイルではないため、ビルドおよびデバッグできません。", "no.compiler.found": "コンパイラが見つかりませんでした", - "select.configuration": "Select a configuration", + "select.configuration": "構成の選択", "cl.exe.not.available": "{0} のビルドとデバッグを使用できるのは、VS 用開発者コマンド プロンプトから VS Code を実行する場合のみです。" } \ No newline at end of file diff --git a/Extension/i18n/kor/src/Debugger/extension.i18n.json b/Extension/i18n/kor/src/Debugger/extension.i18n.json index 95aee2b947..2d0d53a5b9 100644 --- a/Extension/i18n/kor/src/Debugger/extension.i18n.json +++ b/Extension/i18n/kor/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "활성 파일 빌드 및 디버그", "cannot.build.non.cpp": "활성 파일이 C 또는 C++ 소스 파일이 아니므로 빌드 및 디버그할 수 없습니다.", "no.compiler.found": "컴파일러를 찾을 수 없음", - "select.configuration": "Select a configuration", + "select.configuration": "구성 선택", "cl.exe.not.available": "{0} 빌드 및 디버그는 VS의 개발자 명령 프롬프트에서 VS Code를 실행하는 경우에만 사용할 수 있습니다." } \ No newline at end of file diff --git a/Extension/i18n/rus/src/Debugger/extension.i18n.json b/Extension/i18n/rus/src/Debugger/extension.i18n.json index 7cbc47a1f8..78452a97f0 100644 --- a/Extension/i18n/rus/src/Debugger/extension.i18n.json +++ b/Extension/i18n/rus/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Сборка и отладка активного файла", "cannot.build.non.cpp": "Не удается выполнить сборку и отладку, так как активный файл не является исходным файлом C или C++.", "no.compiler.found": "Компилятор не найден", - "select.configuration": "Select a configuration", + "select.configuration": "Выберите конфигурацию.", "cl.exe.not.available": "Сборку и отладку {0} можно использовать только при запуске VS Code из Командной строки разработчика для VS." } \ No newline at end of file diff --git a/Extension/i18n/trk/src/Debugger/extension.i18n.json b/Extension/i18n/trk/src/Debugger/extension.i18n.json index 83ecb8afb0..1b77502133 100644 --- a/Extension/i18n/trk/src/Debugger/extension.i18n.json +++ b/Extension/i18n/trk/src/Debugger/extension.i18n.json @@ -7,6 +7,6 @@ "build.and.debug.active.file": "Etkin dosyayı derle ve dosyada hata ayıkla", "cannot.build.non.cpp": "Etkin dosya bir C ya da C++ kaynak dosyası olmadığından derleme veya hata ayıklama yapılamıyor.", "no.compiler.found": "Derleyici bulunamadı", - "select.configuration": "Select a configuration", + "select.configuration": "Yapılandırma seçin", "cl.exe.not.available": "{0} derlemesi ve hata ayıklama yalnızca VS Code, VS için Geliştirici Komut İstemi'nden çalıştırıldığında kullanılabilir." } \ No newline at end of file From 49d9cfd5ee36b3966df99b008d2adc06ae574205 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 9 Nov 2020 15:56:54 -0800 Subject: [PATCH 4/4] Fix invalid architectures. (#6480) * Fix invalid architectures. --- Extension/CHANGELOG.md | 4 ++ Extension/package.json | 20 +++---- Extension/src/LanguageServer/extension.ts | 2 +- Extension/src/githubAPI.ts | 8 +-- Extension/src/main.ts | 8 ++- Extension/src/packageManager.ts | 2 +- Extension/src/platform.ts | 67 +++++++---------------- 7 files changed, 43 insertions(+), 68 deletions(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index db91f6b743..5971e3c929 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,9 @@ # C/C++ for Visual Studio Code Change Log +## Version 1.1.1: November 9, 2020 +### Bug Fixes +* Fix cpptools binaries sometimes not getting installed on Windows. [#6453](https://github.com/microsoft/vscode-cpptools/issues/6453) + ## Version 1.1.0: November 5, 2020 ### New Features * Add language server support for Windows ARM64 (no debugging yet). [#5583](https://github.com/microsoft/vscode-cpptools/issues/5583) diff --git a/Extension/package.json b/Extension/package.json index e57c854d8b..4e355dd8e8 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.1.0-master", + "version": "1.1.1-master", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md", @@ -2419,7 +2419,7 @@ "linux" ], "architectures": [ - "x86_64" + "x64" ], "binaries": [ "./bin/cpptools", @@ -2476,10 +2476,8 @@ "win32" ], "architectures": [ - "x86_64", - "x86", - "i686", - "i386" + "x64", + "x86" ], "binaries": [ "./bin/cpptools.exe", @@ -2509,7 +2507,7 @@ "linux" ], "architectures": [ - "x86_64" + "x64" ], "binaries": [ "./LLVM/bin/clang-format" @@ -2583,7 +2581,7 @@ "linux" ], "architectures": [ - "x86_64" + "x64" ], "binaries": [ "./debugAdapters/mono.linux-x86_64" @@ -2665,10 +2663,8 @@ "win32" ], "architectures": [ - "x86_64", - "x86", - "i686", - "i386" + "x64", + "x86" ], "binaries": [ "./debugAdapters/vsdbg/bin/vsdbg.exe" diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index df440c22c9..00dcbc16f0 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -332,7 +332,7 @@ function realActivation(): void { PlatformInformation.GetPlatformInformation().then(info => { // Skip Insiders processing for 32-bit Linux. - if (info.platform !== "linux" || info.architecture === "x86_64" || info.architecture === "arm" || info.architecture === "arm64") { + if (info.platform !== "linux" || info.architecture === "x64" || info.architecture === "arm" || info.architecture === "arm64") { // Skip Insiders processing for unsupported VS Code versions. const vscodeVersion: PackageVersion = new PackageVersion(vscode.version); const abTestSettings: ABTestSettings = getABTestSettings(); diff --git a/Extension/src/githubAPI.ts b/Extension/src/githubAPI.ts index a41cbe6b34..4811c7ad9c 100644 --- a/Extension/src/githubAPI.ts +++ b/Extension/src/githubAPI.ts @@ -116,17 +116,15 @@ export function vsixNameForPlatform(info: PlatformInformation): string { switch (platformInfo.platform) { case 'win32': switch (platformInfo.architecture) { - case 'x86_64': return 'cpptools-win32.vsix'; // TODO: Change to cpptools-win64? - case 'x86': - case 'i386': - case 'i686': return 'cpptools-win32.vsix'; + case 'x64': return 'cpptools-win32.vsix'; // TODO: Change to cpptools-win64? + case 'x86': return 'cpptools-win32.vsix'; case 'arm64': return 'cpptools-win-arm64.vsix'; default: throw new Error(`Unexpected Windows architecture: ${platformInfo.architecture}`); } case 'darwin': return 'cpptools-osx.vsix'; default: { switch (platformInfo.architecture) { - case 'x86_64': return 'cpptools-linux.vsix'; + case 'x64': return 'cpptools-linux.vsix'; case 'arm': return 'cpptools-linux-armhf.vsix'; case 'arm64': return 'cpptools-linux-aarch64.vsix'; default: throw new Error(`Unexpected Linux architecture: ${platformInfo.architecture}`); diff --git a/Extension/src/main.ts b/Extension/src/main.ts index 852bb320a1..9aa7164ac8 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -35,8 +35,9 @@ const disposables: vscode.Disposable[] = []; export async function activate(context: vscode.ExtensionContext): Promise { let errMsg: string = ""; - if (process.arch !== 'x64' && (process.platform !== 'win32' || (process.arch !== 'ia32' && process.arch !== 'arm64')) && (process.platform !== 'linux' || (process.arch !== 'x64' && process.arch !== 'arm' && process.arch !== 'arm64' && process.arch !== 'aarch64'))) { - errMsg = localize("architecture.not.supported", "Architecture {0} is not supported. ", String(process.arch)); + const arch: string = os.arch(); + if (arch !== 'x64' && (process.platform !== 'win32' || (arch !== 'ia32' && arch !== 'arm64')) && (process.platform !== 'linux' || (arch !== 'x64' && arch !== 'arm' && arch !== 'arm64'))) { + errMsg = localize("architecture.not.supported", "Architecture {0} is not supported. ", String(arch)); } else if (process.platform === 'linux' && fs.existsSync('/etc/alpine-release')) { errMsg = localize("apline.containers.not.supported", "Alpine containers are not supported."); } @@ -372,7 +373,8 @@ function sendTelemetry(info: PlatformInformation): boolean { util.setProgress(util.getProgressInstallSuccess()); } - installBlob.telemetryProperties['osArchitecture'] = info.architecture ?? ""; + installBlob.telemetryProperties['osArchitecture'] = os.arch(); + installBlob.telemetryProperties['infoArchitecture'] = info.architecture; Telemetry.logDebuggerEvent("acquisition", installBlob.telemetryProperties); diff --git a/Extension/src/packageManager.ts b/Extension/src/packageManager.ts index 4e8b6f21f6..6d1de552c7 100644 --- a/Extension/src/packageManager.ts +++ b/Extension/src/packageManager.ts @@ -491,7 +491,7 @@ export function VersionsMatch(pkg: IPackage, info: PlatformInformation): boolean } export function ArchitecturesMatch(value: IPackage, info: PlatformInformation): boolean { - return !value.architectures || (info.architecture !== undefined && value.architectures.indexOf(info.architecture) !== -1); + return !value.architectures || (value.architectures.indexOf(info.architecture) !== -1); } export function PlatformsMatch(value: IPackage, info: PlatformInformation): boolean { diff --git a/Extension/src/platform.ts b/Extension/src/platform.ts index 32b37bb8b8..b0468e4fc1 100644 --- a/Extension/src/platform.ts +++ b/Extension/src/platform.ts @@ -4,7 +4,6 @@ * ------------------------------------------------------------------------------------------ */ import * as os from 'os'; -import * as util from './common'; import { LinuxDistribution } from './linuxDistribution'; import * as plist from 'plist'; import * as fs from 'fs'; @@ -24,26 +23,23 @@ export function GetOSName(processPlatform: string | undefined): string | undefin } export class PlatformInformation { - constructor(public platform: string, public architecture?: string, public distribution?: LinuxDistribution, public version?: string) { } + constructor(public platform: string, public architecture: string, public distribution?: LinuxDistribution, public version?: string) { } public static GetPlatformInformation(): Promise { const platform: string = os.platform(); - let architecturePromise: Promise; + const architecture: string = PlatformInformation.GetArchitecture(); let distributionPromise: Promise = Promise.resolve(undefined); let versionPromise: Promise = Promise.resolve(undefined); switch (platform) { case "win32": - architecturePromise = PlatformInformation.GetWindowsArchitecture(); break; case "linux": - architecturePromise = PlatformInformation.GetUnixArchitecture(); distributionPromise = LinuxDistribution.GetDistroInformation(); break; case "darwin": - architecturePromise = PlatformInformation.GetUnixArchitecture(); versionPromise = PlatformInformation.GetDarwinVersion(); break; @@ -51,50 +47,29 @@ export class PlatformInformation { throw new Error(localize("unknown.os.platform", "Unknown OS platform")); } - return Promise.all([architecturePromise, distributionPromise, versionPromise]) - .then(([arch, distro, version]) => - new PlatformInformation(platform, arch, distro, version) + return Promise.all([distributionPromise, versionPromise]) + .then(([distro, version]) => + new PlatformInformation(platform, architecture, distro, version) ); } - public static GetUnknownArchitecture(): string { return "Unknown"; } - - private static GetWindowsArchitecture(): Promise { - return util.execChildProcess('wmic os get osarchitecture', util.extensionPath) - .then((architecture) => { - if (architecture) { - const archArray: string[] = architecture.split(os.EOL); - if (archArray.length >= 2) { - const arch: string = archArray[1].trim(); - - // Note: This string can be localized. So, we'll just check to see if it contains 32 or 64. - if (arch.indexOf('64') >= 0) { - if (arch.indexOf('ARM') >= 0) { - return "arm64"; - } - return "x86_64"; - } else if (arch.indexOf('32') >= 0) { - return "x86"; - } - } - } - return PlatformInformation.GetUnknownArchitecture(); - }).catch((error) => PlatformInformation.GetUnknownArchitecture()); - } - - private static GetUnixArchitecture(): Promise { - return util.execChildProcess('uname -m', util.packageJson.extensionFolderPath) - .then((architecture) => { - if (architecture) { - if (architecture.startsWith('arm64') || architecture.startsWith('aarch64')) { - return 'arm64'; - } else if (architecture.startsWith('armv')) { - return 'arm'; - } - return architecture.trim(); + public static GetArchitecture(): string { + const arch: string = os.arch(); + switch (arch) { + case "x64": + case "arm64": + case "arm": + return arch; + case "x32": + case "ia32": + return "x86"; + default: + if (os.platform() === "win32") { + return "x86"; + } else { + return "x64"; } - return undefined; - }); + } } private static GetDarwinVersion(): Promise {