Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/app/windows.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ export function getWindowsRegistryItem(hive: HKEY, path: string, name: string):
throw new Error('getWindowsRegistryItem is only available on Windows')
}

if (process.arch !== 'x64') {
throw new Error('getWindowsRegistryItem is only available on x64')
if (process.arch !== 'x64' && process.arch !== 'arm64') {
throw new Error('getWindowsRegistryItem is only available on x64 and arm64')
}

let windowRegistry
try {
const require = createRequire(import.meta.url)
const windowRegistry = require('@vscode/windows-registry/prebuilds/win32-x64/@vscode+windows-registry.node')
windowRegistry = require(`@vscode/windows-registry/prebuilds/win32-${process.arch}/@vscode+windows-registry.node`)
} catch {
console.error('Error loading @vscode/windows-registry')
return undefined
Comment on lines 27 to +32
}

try {
return windowRegistry.GetStringRegKey(hive, path, name)
} catch (error) {
// 'Unable to open registry key' is expected when the registry key does not exist
Expand Down
Loading