mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-17 03:38:32 +02:00
Enhance OS architecture detection methods in install.ps1 (#1498)
This commit is contained in:
@@ -99,7 +99,29 @@ function Install-CliBinary {
|
||||
}
|
||||
|
||||
# Distinguish amd64 vs arm64 — Is64BitOperatingSystem is true for both.
|
||||
$osArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
|
||||
# Use multiple detection methods for robustness
|
||||
$osArch = $null
|
||||
|
||||
# Method 1: RuntimeInformation (primary)
|
||||
try {
|
||||
$osArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
|
||||
} catch {}
|
||||
|
||||
# Method 2: PROCESSOR_ARCHITECTURE environment variable
|
||||
if (-not $osArch) {
|
||||
$envArch = $env:PROCESSOR_ARCHITECTURE
|
||||
if ($envArch -eq "AMD64") { $osArch = 'X64' }
|
||||
elseif ($envArch -eq "ARM64") { $osArch = 'Arm64' }
|
||||
}
|
||||
|
||||
# Method 3: PROCESSOR_ARCHITEW6432 (for 32-bit PowerShell on 64-bit Windows)
|
||||
if (-not $osArch) {
|
||||
$envArch = $env:PROCESSOR_ARCHITEW6432
|
||||
if ($envArch -eq "AMD64") { $osArch = 'X64' }
|
||||
elseif ($envArch -eq "ARM64") { $osArch = 'Arm64' }
|
||||
}
|
||||
|
||||
# Determine architecture
|
||||
switch ($osArch) {
|
||||
'X64' { $arch = "amd64" }
|
||||
'Arm64' { $arch = "arm64" }
|
||||
|
||||
Reference in New Issue
Block a user