Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

firefox keeps updating the same mar file

  • 3 답장
  • 1 이 문제를 만남
  • 5 보기
  • 최종 답변자: 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>
첨부된 스크린샷

선택된 해결법

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.

문맥에 따라 이 답변을 읽어주세요 👍 0

모든 댓글 (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

선택된 해결법

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.