Skip to content

Commit

Permalink
(firefox) fix update script
Browse files Browse the repository at this point in the history
  • Loading branch information
mkevenaar committed Jan 5, 2025
1 parent 55adecf commit f9e341a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions automatic/firefox/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ param($IncludeStream, [switch] $Force)
Import-Module Chocolatey-AU
. "$PSScriptRoot\update_helper.ps1"

$releasesBETA = 'https://www.mozilla.org/en-US/firefox/beta/all/'
$releasesDEV = 'https://www.mozilla.org/en-US/firefox/developer/all/'
$releasesBETA = 'https://www.mozilla.org/en-US/firefox/all/desktop-beta/win/en-US/'
$releasesDEV = 'https://www.mozilla.org/en-US/firefox/all/desktop-developer/win/en-US/'
$product = 'firefox'

function global:au_BeforeUpdate {
Expand All @@ -18,6 +18,7 @@ function global:au_AfterUpdate {
-Product $product `
-ExtendedRelease:$($Latest.PackageName -eq 'FirefoxESR') `
-DevelopmentRelease:$($Latest.PackageName -eq 'firefox-dev') `

}

function global:au_SearchReplace {
Expand All @@ -28,7 +29,7 @@ function global:au_SearchReplace {
function global:au_GetLatest {

$streams = @{}

$data = GetVersionAndUrlFormats -UpdateUrl $releasesBETA -Product "${product}-beta"
$version = $data.Version
$betaversion = $version -replace "b", "."
Expand Down
1 change: 1 addition & 0 deletions automatic/firefox/update_helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function GetVersionAndUrlFormats() {
)

$download_page = Invoke-WebRequest -UseBasicParsing -Uri $UpdateUrl

$re = "download.mozilla.*product=$Product.*(&|&)os=win(&|&)lang=en-US"
$url = $download_page.links | Where-Object href -match $re | Select-Object -first 1 -expand href
$url = Get-RedirectedUrl $url
Expand Down

0 comments on commit f9e341a

Please sign in to comment.