Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Native/probe-win.ps110
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Native/probe-win.ps1 b/src/Native/probe-win.ps1
index 70030b14d..2eb96ea40 100644
--- a/src/Native/probe-win.ps1
+++ b/src/Native/probe-win.ps1
@@ -6,7 +6,7 @@ function GetCMakeVersions
$items = @()
$items += @(Get-ChildItem hklm:\SOFTWARE\Wow6432Node\Kitware -ErrorAction SilentlyContinue)
$items += @(Get-ChildItem hklm:\SOFTWARE\Kitware -ErrorAction SilentlyContinue)
- return $items | where { $_.PSChildName.StartsWith("CMake ") }
+ return $items | where { $_.PSChildName.StartsWith("CMake") }
}
function GetCMakeInfo($regKey)
@@ -17,7 +17,13 @@ function GetCMakeInfo($regKey)
catch {
return $null
}
- $cmakeDir = (Get-ItemProperty $regKey.PSPath).'(default)'
+ $itemProperty = Get-ItemProperty $regKey.PSPath;
+ if (Get-Member -inputobject $itemProperty -name "InstallDir" -Membertype Properties) {
+ $cmakeDir = $itemProperty.InstallDir
+ }
+ else {
+ $cmakeDir = $itemProperty.'(default)'
+ }
$cmakePath = [System.IO.Path]::Combine($cmakeDir, "bin\cmake.exe")
if (![System.IO.File]::Exists($cmakePath)) {
return $null