Skip to content

Commit 3a7810c

Browse files
authored
Merge pull request #36 from jwittner/fix/patchInstallFind
Fix a couple of issues around patch releases
2 parents d1c6ba8 + e8f6e95 commit 3a7810c

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
@@ -190,10 +190,15 @@ function Find-UnitySetupInstaller
190190
'f' { $searchPages += "https://unity3d.com/get-unity/download/archive" }
191191
'b' { $searchPages += "https://unity3d.com/unity/beta/unity$Version" }
192192
'p' {
193-
$webResult = Invoke-WebRequest "https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)"
194-
$searchPages += $webResult.Links | Where-Object { $_.href -match "\/unity\/qa\/patch-releases\?version=$($Version.Major)\.$($Version.Minor)&page=(\d+)" } | ForEach-Object {
195-
"https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)&page=$($Matches[1])"
196-
}
193+
$patchPage = "https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)"
194+
$searchPages += $patchPage
195+
196+
$webResult = Invoke-WebRequest $patchPage
197+
$searchPages += $webResult.Links | Where-Object {
198+
$_.href -match "\/unity\/qa\/patch-releases\?version=$($Version.Major)\.$($Version.Minor)&page=(\d+)" -and $Matches[1] -gt 1
199+
} | ForEach-Object {
200+
"https://unity3d.com/unity/qa/patch-releases?version=$($Version.Major).$($Version.Minor)&page=$($Matches[1])"
201+
}
197202
}
198203
}
199204

@@ -204,7 +209,7 @@ function Find-UnitySetupInstaller
204209
$_ -match "$($installerTemplates[[UnitySetupComponentType]::Setup])$"
205210
}
206211

207-
if($null -eq $prototypeLink) { break }
212+
if($null -ne $prototypeLink) { break }
208213
}
209214

210215
if($null -eq $prototypeLink)

0 commit comments

Comments
 (0)