自动更新扩展程序不起作用

时间:2012-07-24 12:42:23

标签: firefox firefox-addon distribution automatic-updates

我为自动更新服务写了一个update.rdf。

在添加概述中,可以右键单击“搜索新更新”,firefox在我的测试网站空间中找到新版本,下载并“安装”它。但重启后我和之前的版本一样,没有改变xpi文件。这是一些图片和代码片段。 Mabye你有个主意。

http://s12.postimage.org/f68kptdy3/script_error1.png

http://s12.postimage.org/57nm3c4ij/script_error2.png

重新启动后,我再次使用版本0.2.3而没有任何更改。

版本0.2.3的install.rdf

代码:全选          

   <Description about="urn:mozilla:install-manifest">

      <em:id>megxbar@megx.net</em:id>
      <em:type>2</em:type>
      <em:name>MegxBar</em:name>
      <em:version>0.2.3</em:version>
       .
       .
       .
      <em:updateURL>http://home.arcor.de/eniac2000/update.rdf</em:updateURL>           <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDO65zOLKafZWtmX/cvs9ELMT1VkCQ8GlZNbRMku0su8VxDr+k4eGFYUupHWy2Ll+rfXJ43k+nYQvYHZRoU94DtiCCk4GEpfGytQPCCHOl30aV9elJH+cmeSKZiejPvMptZfp9GXTcLWgVycPVwS59J/LFJ2St2QQSv2hgWV1dKlwIDAQAB</em:updateKey>
      <em:targetApplication>
         <Description>
            <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
            <em:minVersion>1.5</em:minVersion>
            <em:maxVersion>15.0</em:maxVersion>
         </Description>
      </em:targetApplication>   
   </Description>
</RDF>

update.rdf with signature(在服务器上)

<?xml version="1.0"?>
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
         xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Description RDF:about="rdf:#$ZpuSg3"
                   em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
                   em:minVersion="1.5"
                   em:maxVersion="15.0"
                   em:updateLink="http://home.arcor.de/eniac2000/MegxBar_0.3.3.xpi"
                   em:updateHash="sha1:02226eedd92e895379881ec919ce07c7f73ff9a9" />
  <RDF:Seq RDF:about="rdf:#$VpuSg3">
    <RDF:li RDF:resource="rdf:#$WpuSg3"/>
  </RDF:Seq>
  <RDF:Description RDF:about="rdf:#$WpuSg3"
                   em:version="0.3.3">
    <em:targetApplication RDF:resource="rdf:#$ZpuSg3"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mozilla:extension:megxbar@megx.net"
                   em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBAFOK3mZUdai/KCVRtHNvTYPV7Hu3+3b9ymfkGM3u08m0O7Ltl1tc0guYtZ74i+qUYC8T+66pgK/LeXnwzAHFUBcEfXFZGfwH8ZG8SR/lyZaUzSsAM9CPoYv1YIM/PjLfHtIEJdzROW1HG31YlsP3nouT5wSyEhvJiNQvAUwP37Aj">
    <em:updates RDF:resource="rdf:#$VpuSg3"/>
  </RDF:Description>
</RDF:RDF>

在服务器上的版本0.3.3的xpi中安装.rdf

<?xml version="1.0" encoding="UTF-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:em="http://www.mozilla.org/2004/em-rdf#">

   <Description about="urn:mozilla:install-manifest">

      <em:id>megxbar@megx.net</em:id>
      <em:type>2</em:type>
      <em:name>MegxBar</em:name>
      <em:version>0.3.3</em:version>
         .
         .
         .
      <em:updateURL>http://home.arcor.de/eniac2000/update.rdf</em:updateURL>
      <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDO65zOLKafZWtmX/cvs9ELMT1VkCQ8GlZNbRMku0su8VxDr+k4eGFYUupHWy2Ll+rfXJ43k+nYQvYHZRoU94DtiCCk4GEpfGytQPCCHOl30aV9elJH+cmeSKZiejPvMptZfp9GXTcLWgVycPVwS59J/LFJ2St2QQSv2hgWV1dKlwIDAQAB</em:updateKey>
      <em:targetApplication>
         <Description>
            <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
            <em:minVersion>1.5</em:minVersion>
            <em:maxVersion>15.0</em:maxVersion>
         </Description>
      </em:targetApplication>   
   </Description> 
</RDF>

我使用MCCOY创建了签名,并使用用于windows的备用哈希生成器创建了哈希值

1 个答案:

答案 0 :(得分:1)

如果我从您的服务器下载MegxBar_0.3.3.xpi并查看我看到的install.rdf文件:

<em:version>0.2.3</em:version>

因此Firefox正确更新您的扩展程序并安装新版本。唯一的问题是服务器上的“新”版本是旧版本,尽管文件名是。

相关问题