Skip to content

Commit e8f6e95

Browse files
committed
Fix a couple of issues around patch releases
1 parent 7cbe428 commit e8f6e95

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,15 @@ function Find-UnitySetupInstaller
182182
'f' { $searchPages += "https://unity3d.com/get-unity/download/archive" }
183183
'b' { $searchPages += "https://unity3d.com/unity/beta/unity$Version" }
184184
'p' {
185-
$webResult = Invoke-WebRequest "https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)"
186-
$searchPages += $webResult.Links | Where-Object { $_.href -match "\/unity\/qa\/patch-releases\?version=$($Version.Major)\.$($Version.Minor)&page=(\d+)" } | ForEach-Object {
187-
"https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)&page=$($Matches[1])"
188-
}
185+
$patchPage = "https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)"
186+
$searchPages += $patchPage
187+
188+
$webResult = Invoke-WebRequest $patchPage
189+
$searchPages += $webResult.Links | Where-Object {
190+
$_.href -match "\/unity\/qa\/patch-releases\?version=$($Version.Major)\.$($Version.Minor)&page=(\d+)" -and $Matches[1] -gt 1
191+
} | ForEach-Object {
192+
"https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)&page=$($Matches[1])"
193+
}
189194
}
190195
}
191196

@@ -196,7 +201,7 @@ function Find-UnitySetupInstaller
196201
$_ -match "$($installerTemplates[[UnitySetupComponentType]::Setup])$"
197202
}
198203

199-
if($null -eq $prototypeLink) { break }
204+
if($null -ne $prototypeLink) { break }
200205
}
201206

202207
if($null -eq $prototypeLink)

0 commit comments

Comments
 (0)