mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
Add functions to find Program Files folders on the powershell side
This commit is contained in:
parent
a7c5063d4d
commit
444f28dd24
@ -18,7 +18,9 @@ foreach ($instance in $VisualStudio2017InstallationInstances)
|
||||
}
|
||||
|
||||
# VS2015
|
||||
$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}"
|
||||
$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1
|
||||
$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1
|
||||
$CandidateProgramFiles = $programFiles32, $programFilesP
|
||||
foreach ($ProgramFiles in $CandidateProgramFiles)
|
||||
{
|
||||
$clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe"
|
||||
|
@ -4,7 +4,9 @@ param(
|
||||
)
|
||||
|
||||
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
|
||||
$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}"
|
||||
$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1
|
||||
$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1
|
||||
$CandidateProgramFiles = $programFiles32, $programFilesP
|
||||
|
||||
# Windows 10 SDK
|
||||
foreach ($ProgramFiles in $CandidateProgramFiles)
|
||||
|
11
scripts/getProgramFiles32bit.ps1
Normal file
11
scripts/getProgramFiles32bit.ps1
Normal file
@ -0,0 +1,11 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
|
||||
)
|
||||
|
||||
if (Test-Path env:PROGRAMFILES`(X86`))
|
||||
{
|
||||
return ${env:PROGRAMFILES(X86)}
|
||||
}
|
||||
|
||||
return ${env:PROGRAMFILES}
|
11
scripts/getProgramFilesPlatformBitness.ps1
Normal file
11
scripts/getProgramFilesPlatformBitness.ps1
Normal file
@ -0,0 +1,11 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
|
||||
)
|
||||
|
||||
if (Test-Path env:ProgramW6432)
|
||||
{
|
||||
return ${env:ProgramW6432}
|
||||
}
|
||||
|
||||
return ${env:PROGRAMFILES}
|
Loading…
x
Reference in New Issue
Block a user