aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-02-16 20:00:00 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2017-02-16 20:00:00 -0800
commit0dbc59da7a582612171fbc7985f71470265062b9 (patch)
tree892c151c9fc51aa3d3a705cf8b8f6f4d077fe2a4 /scripts
parentcf537a2623efa6c892afce3301ffb98ad46a6b1e (diff)
downloadvcpkg-0dbc59da7a582612171fbc7985f71470265062b9.tar.gz
vcpkg-0dbc59da7a582612171fbc7985f71470265062b9.zip
Fix script for powershell in Win7
Diffstat (limited to 'scripts')
-rw-r--r--scripts/findAnyMSBuildWithCppPlatformToolset.ps117
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1
index 15234a2f8..72155b4f5 100644
--- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1
+++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1
@@ -33,19 +33,28 @@ if (-not $DisableVS2015)
# In 64-bit systems, this is under the Wow6432Node.
try
{
- $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir)
+ $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir })
Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 - Found"
}
catch
{
- $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir)
+ $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir })
Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 - Found"
}
if (!(Test-Path "${VS14InstallDir}..\..\VC\bin\cl.exe")) { throw }
Write-Verbose "${VS14InstallDir}..\..\VC\bin\cl.exe - Found"
- $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % MSBuildToolsPath)
- Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found"
+
+ try
+ {
+ $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath })
+ Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 - Found"
+ }
+ catch
+ {
+ $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath })
+ Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found"
+ }
if (!(Test-Path "${MSBuild14}MSBuild.exe")) { throw }
Write-Verbose "${MSBuild14}MSBuild.exe - Found"