mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 12:28:14 +08:00
Improve functions that detect ProgramFiles in powershell
This commit is contained in:
parent
e4ff363f5c
commit
60e67651c3
@ -3,9 +3,15 @@ param(
|
||||
|
||||
)
|
||||
|
||||
if (Test-Path env:PROGRAMFILES`(X86`))
|
||||
$out = ${env:PROGRAMFILES(X86)}
|
||||
if ($out -eq $null)
|
||||
{
|
||||
return ${env:PROGRAMFILES(X86)}
|
||||
$out = ${env:PROGRAMFILES}
|
||||
}
|
||||
|
||||
return ${env:PROGRAMFILES}
|
||||
if ($out -eq $null)
|
||||
{
|
||||
throw "Could not find [Program Files 32-bit]"
|
||||
}
|
||||
|
||||
return $out
|
@ -3,9 +3,15 @@ param(
|
||||
|
||||
)
|
||||
|
||||
if (Test-Path env:ProgramW6432)
|
||||
$out = ${env:ProgramW6432}
|
||||
if ($out -eq $null)
|
||||
{
|
||||
return ${env:ProgramW6432}
|
||||
$out = ${env:PROGRAMFILES}
|
||||
}
|
||||
|
||||
return ${env:PROGRAMFILES}
|
||||
if ($out -eq $null)
|
||||
{
|
||||
throw "Could not find [Program Files Platform Bitness]"
|
||||
}
|
||||
|
||||
return $out
|
Loading…
x
Reference in New Issue
Block a user