Skip to content

Commit

Permalink
Merge pull request #2574 from TheCakeIsNaOH/virtualbox-extension-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm authored Dec 2, 2024
2 parents 41e7678 + d5667a6 commit 3e97500
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion automatic/virtualbox/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@ function GetLatest {
$url = $download_page.links | Where-Object href -match '\.exe$' | Select-Object -first 1 -expand href
$version = $url -split '/' | Select-Object -Last 1 -Skip 1
$base_url = $url -replace '[^/]+$'

$majorVersion = $version.split("\.") | Select-Object -First 1
$minorVersion = $version.split("\.") | Select-Object -First 1 -Skip 1
if ([int]$majorVersion -gt 7) {
$URLep = "${base_url}Oracle_VirtualBox_Extension_Pack-${version}.vbox-extpack"
} elseif (([int]$majorVersion -eq 7) -and ([int]$minorVersion -ge 1)) {
$URLep = "${base_url}Oracle_VirtualBox_Extension_Pack-${version}.vbox-extpack"
} else {
$URLep = "${base_url}Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack"
}

@{
URL32 = $url
URLep = "${base_url}Oracle_VM_VirtualBox_Extension_Pack-${version}.vbox-extpack"
URLep = $URLep
Version = $version
}
}
Expand Down

0 comments on commit 3e97500

Please sign in to comment.