Skip to content

Commit

Permalink
Update arm64 Windows detection method
Browse files Browse the repository at this point in the history
  • Loading branch information
corbindavenport committed Jun 29, 2024
1 parent 08cb3ec commit d78ebf2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/sys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ Future<String> getCPUArchitecture() async {
// Possible values: AMD64, ARM64
var cpu = envVars['PROCESSOR_ARCHITECTURE'];
// Check if being emulated in ARM and return true architecture
var isEmulated = await io.Directory('C:\Program Files (Arm)').exists();
if (isEmulated) {
cpu = 'ARM64';
try {
var buildArch = await io.Process.run('reg', ['query', r'HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\BuildLayers\DesktopEditions', '/v', 'BuildArch']);
if (buildArch.stdout.toString().contains('arm64')) {
cpu = 'ARM64';
}
} catch (e) {
// Fail silently
}
return cpu;
} else {
Expand Down

0 comments on commit d78ebf2

Please sign in to comment.