aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2024-04-12 06:23:45 +0200
committerOliver Wolff <oliver.wolff@qt.io>2024-04-20 08:37:08 +0200
commit8fae627f8b6440c900544fc76d2e68735496c2e8 (patch)
treea51b4508205a800f14d61f1c5813accc30000d24
parent0477a26495538586e23a0e4147013cda23d9ee96 (diff)
Provisioning: Add Get-CpuArchitecture helper function
For the addition of ARM64 to our checked packages, this helper function will come in handy as it is more fine grained than Is64BitHost. Change-Id: I8956c1ca6e445c0b783a39e4d42069199496f053 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
-rw-r--r--coin/provisioning/common/windows/helpers.ps122
1 files changed, 22 insertions, 0 deletions
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1
index 8f29d121..d6ed9bbf 100644
--- a/coin/provisioning/common/windows/helpers.ps1
+++ b/coin/provisioning/common/windows/helpers.ps1
@@ -196,6 +196,28 @@ function Is64BitWinHost
return [environment]::Is64BitOperatingSystem
}
+enum CpuArch {
+ x64
+ x86
+ arm64
+ unknown
+}
+
+function Get-CpuArchitecture
+{
+ # Possible values are "AMD64", "IA64", "ARM64", and "x86"
+ $arch = [System.Environment]::GetEnvironmentVariable('PROCESSOR_ARCHITECTURE', 'Machine')
+ if ($arch -eq "AMD64") {
+ return [CpuArch]::x64
+ } elseif ($arch -eq "x86") {
+ return [CpuArch]::x86
+ } elseif ($arch -eq "ARM64") {
+ return [CpuArch]::arm64
+ }
+
+ return [CpuArch]::unknown
+}
+
function IsProxyEnabled {
return (Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').proxyEnable
}