1
>
/*---------------------------------------------------------------------------------------------
windowsVersion.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import * as os from 'os';
7
>
import { isWindows } from '../common/platform.js';
8
>
9
>
let versionInfo: { release: string; buildNumber: number } | undefined;
10
>
11
>
/**
12
>
* Initializes the Windows version cache by reading from the registry.
13
>
*
14
>
* On Windows 8.1+, the `os.release()` function may return incorrect version numbers
15
>
* due to the deprecated GetVersionEx API returning compatibility-shimmed values
16
>
* when the application doesn't have a proper manifest. Reading from the registry
17
>
* gives us the real version.
18
>
*
19
>
* See: https://github.com/microsoft/vscode/issues/197444
20
>
*/
21
export async function initWindowsVersionInfo() {
22
if (versionInfo) {