Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Hierdie gesprek is in die argief. Vra asseblief 'n nuwe vraag as jy hulp nodig het.

firefox keeps updating the same mar file

  • 3 antwoorde
  • 1 het hierdie probleem
  • 43 views
  • Laaste antwoord deur zbence

more options

Hi,

I have made an update server following the article: https://firefox-source-docs.mozilla.org/taskcluster/setting-up-an-update-server.html The server works perfectly, my clients can see the update.xml and the mar file, but even after the client updates itself, it can not identify the update as the same and tries to update again and again...

My update xml is like this: <updates>

  <update type="minor" displayVersion="83.0" appVersion="83.0" platformVersion="83.0" buildID="21181002100236">
Hi, I have made an update server following the article: https://firefox-source-docs.mozilla.org/taskcluster/setting-up-an-update-server.html The server works perfectly, my clients can see the update.xml and the mar file, but even after the client updates itself, it can not identify the update as the same and tries to update again and again... My update xml is like this: <?xml version="1.0" encoding="utf-8"?> <updates> <update type="minor" displayVersion="83.0" appVersion="83.0" platformVersion="83.0" buildID="21181002100236"> <patch type="complete" URL="http://<myserver>/firefox-83.0.complete.mar" hashFunction="sha512" hashValue="A8B8FEDEAEE383D2D712B8303C2BEBC88133939A7B691E7BA7CC3D4A220BDE22D33FA0D57BD0060036BC533AAD69F972D1BB6F8EFB385E5B59C8BBE3A6734A52" size="61899176" /> </update> </updates>
Aangehegde skermkiekies

Gekose oplossing

Hi, It seems that the MAR file does not contains the build number directly. It contains the "application.ini", which holds this information. I have written a powershell script which can extract the file for me, 7zip can extract that ini file so I could parse it's content. As long this information stays in there, I'm happy.

The relevant part of this script:

$file = [System.IO.File]::ReadAllBytes($localfile) function Read-4bytes{ Param ( [int]$offset ) Process { return $file[$offset]*256*256*256+$file[$offset+1]*256*256+$file[$offset+2]*256+$file[$offset+3] } } $indexoffset = Read-4bytes(4) $indexsize = Read-4bytes($indexoffset) $remaining = $indexsize $pointer = $indexoffset + 4 while($remaining -gt 0){ $filename = "" $contentoffset = Read-4bytes($pointer) $contentsize = Read-4bytes($pointer+4) $flags = Read-4bytes($pointer+8) $pointer+=12 while($file[$pointer] -gt 0){ $filename += [char]$file[$pointer] $pointer++ $remaining-- } $pointer++ $remaining-=13 if($filename -eq "application.ini"){$remaining=0} } $content = @() for($i = 0; $i -lt $contentsize; $i++){ $content += $file[$contentoffset+$i] } $tempout = $localfolder + "temp.i" [System.IO.File]::WriteAllBytes($tempout, $content) $unzipfile = $localfolder + "temp" c:\tools\7z.exe e $tempout -o"$localfolder" $appini=Get-Content $unzipfile $buildID = ($appini -like "buildid*").split("=")[1] remove-item $tempout remove-item $unzipfile

It is not bulletproof, but works.

Lees dié antwoord in konteks 👍 0

All Replies (3)

more options

It seems that the xml content is not showing correctly, so I've attached a screenshot of it.

more options

Hi, I could find out why it is keep updating itself. The buildID in the update.xml is much higher than in the real update file. If I can put the correct buildID in the xml, it stops the update cycle. Now my question - how could I get the correct buildID from the MAR file itself?

more options

Gekose oplossing

Hi, It seems that the MAR file does not contains the build number directly. It contains the "application.ini", which holds this information. I have written a powershell script which can extract the file for me, 7zip can extract that ini file so I could parse it's content. As long this information stays in there, I'm happy.

The relevant part of this script:

$file = [System.IO.File]::ReadAllBytes($localfile) function Read-4bytes{ Param ( [int]$offset ) Process { return $file[$offset]*256*256*256+$file[$offset+1]*256*256+$file[$offset+2]*256+$file[$offset+3] } } $indexoffset = Read-4bytes(4) $indexsize = Read-4bytes($indexoffset) $remaining = $indexsize $pointer = $indexoffset + 4 while($remaining -gt 0){ $filename = "" $contentoffset = Read-4bytes($pointer) $contentsize = Read-4bytes($pointer+4) $flags = Read-4bytes($pointer+8) $pointer+=12 while($file[$pointer] -gt 0){ $filename += [char]$file[$pointer] $pointer++ $remaining-- } $pointer++ $remaining-=13 if($filename -eq "application.ini"){$remaining=0} } $content = @() for($i = 0; $i -lt $contentsize; $i++){ $content += $file[$contentoffset+$i] } $tempout = $localfolder + "temp.i" [System.IO.File]::WriteAllBytes($tempout, $content) $unzipfile = $localfolder + "temp" c:\tools\7z.exe e $tempout -o"$localfolder" $appini=Get-Content $unzipfile $buildID = ($appini -like "buildid*").split("=")[1] remove-item $tempout remove-item $unzipfile

It is not bulletproof, but works.