Correct the path name of Visual Studio 2017 tools.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Mon, 27 Aug 2018 05:37:05 +0000 (14:37 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Tue, 28 Aug 2018 11:14:31 +0000 (20:14 +0900)
winbuild/MSProgram-Get.psm1

index 1631ff53dd11b3d28724ee90bc593b6c15d9cc68..a51e8d92b3eeebefde8e72276475827ec45c7498 100644 (file)
@@ -380,8 +380,8 @@ function find_vsdir_15_xx
            $vssetup_available = $false
        }
    }
+   $toolsnum = [int]$toolsver
    if ($vssetup -ne $null) {
-       $toolsnum = [int]$toolsver
        $lslist = @($vssetup | where-object { $_.InstallationVersion.Major -eq $toolsnum } | foreach-object { $_.InstallationPath })
        if ($lslist.Count -gt 0) {
            return $lslist[0] + "\"
@@ -394,7 +394,7 @@ function find_vsdir_15_xx
    } else {
        $pgmfs = "${env:ProgramFiles(x86)}"
    }
-   $lslist = @(Get-ChildItem "$pgmfs\Microsoft Visual Studio\*\*\MSBuild\$toolsver\Bin\MSBuild.exe" -ErrorAction SilentlyContinue)
+   $lslist = @(Get-ChildItem "$pgmfs\Microsoft Visual Studio\*\*\MSBuild\$toolsnum.0\Bin\MSBuild.exe" -ErrorAction SilentlyContinue)
    if ($lslist.Count -gt 0) {
        return (Split-Path (Split-Path (Split-Path (Split-Path $lslist[0].FullName -Parent) -Parent) -Parent) -Parent) + "\"
    }