Skip to content

Commit

Permalink
Fix support VS old versions in VSBuildV1 task (#15271)
Browse files Browse the repository at this point in the history
* fix old versions

* bump version

Co-authored-by: annaOpareva <v-aopareva@microsoft.com>
  • Loading branch information
AnnaOpareva and annaOpareva authored Sep 10, 2021
1 parent 6f23a7c commit 182fbef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions Tasks/VSBuildV1/Get-VSPath.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ function Get-VSPath {
[Parameter(Mandatory = $true)]
[string]$Version)

$Versions = @('15.0', '16.0', '17.0')
$Versions = @('10.0', '11.0', '12.0','14.0','15.0', '16.0', '17.0')
Trace-VstsEnteringInvocation $MyInvocation

try {
if ( !($Version -in $Versions )) {
Write-Warning "Please enter one of the versions 15.0, 16.0, 17.0"
} else {
Write-Warning "Please enter one of the versions 10.0, 11.0, 12.0, 14.0, 15.0, 16.0, 17.0"
} else {
$VersionNumber = [int]$Version.Remove(2)
# Search for more than 15.0 Willow instance.
if ($VersionNumber -ge 15) {
if (($instance = Get-VisualStudio $VersionNumber) -and
$instance.installationPath) {

$instance.installationPath) {
return $instance.installationPath
}

}
}
# Fallback to searching for an older install.
if ($path = (Get-ItemProperty -LiteralPath "HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\$Version" -Name 'ShellFolder' -ErrorAction Ignore).ShellFolder) {
return $path
return $path
}
}
}
} finally {
Trace-VstsLeavingInvocation $MyInvocation
}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/VSBuildV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 192,
"Patch": 2
"Patch": 3
},
"demands": [
"msbuild",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/VSBuildV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 192,
"Patch": 2
"Patch": 3
},
"demands": [
"msbuild",
Expand Down

0 comments on commit 182fbef

Please sign in to comment.