diff options
| author | Phil Christensen <philc@microsoft.com> | 2018-12-06 15:06:28 -0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2018-12-06 15:06:28 -0800 |
| commit | 7347305e8459fcc78553a9f88196e0d93eb0a8fe (patch) | |
| tree | ac9eee9ff267c6a71a83249bed7a94f02b00d9a5 /scripts/findVisualStudioInstallationInstances.ps1 | |
| parent | ed9357a5aafea7192932b5874264bd103fc61255 (diff) | |
| parent | 63c1b2628e958f8e02356411f032941c0c2f3bbb (diff) | |
| download | vcpkg-7347305e8459fcc78553a9f88196e0d93eb0a8fe.tar.gz vcpkg-7347305e8459fcc78553a9f88196e0d93eb0a8fe.zip | |
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/3425
Diffstat (limited to 'scripts/findVisualStudioInstallationInstances.ps1')
| -rw-r--r-- | scripts/findVisualStudioInstallationInstances.ps1 | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 deleted file mode 100644 index cb51c345d..000000000 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -[CmdletBinding()] -param( - -) -Set-StrictMode -Version Latest -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - -$vswhereExe = (& $scriptsDir\fetchTool.ps1 "vswhere") -replace "<sol>::" -replace "::<eol>" - -$output = & $vswhereExe -prerelease -legacy -products * -format xml -[xml]$asXml = $output - -$results = New-Object System.Collections.ArrayList -foreach ($instance in $asXml.instances.instance) -{ - $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash - $installationVersion = $instance.InstallationVersion - - $isPrerelease = -7 - if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") - { - $isPrerelease = $instance.isPrerelease - } - - if ($isPrerelease -eq 0) - { - $releaseType = "PreferenceWeight3::StableRelease" - } - elseif ($isPrerelease -eq 1) - { - $releaseType = "PreferenceWeight2::PreRelease" - } - else - { - $releaseType = "PreferenceWeight1::Legacy" - } - - # Placed like that for easy sorting according to preference - $results.Add("<sol>::${releaseType}::${installationVersion}::${installationPath}::<eol>") > $null -} - -# If nothing is found, attempt to find VS2015 Build Tools (not detected by vswhere.exe) -if ($results.Count -eq 0) -{ - $programFiles = & $scriptsDir\getProgramFiles32bit.ps1 - $installationPath = "$programFiles\Microsoft Visual Studio 14.0" - $clExe = "$installationPath\VC\bin\cl.exe" - $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" - - if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) - { - return "<sol>::PreferenceWeight1::Legacy::14.0::$installationPath::<eol>" - } -} - - -$results.Sort() -$results.Reverse() - -return $results
\ No newline at end of file |
