16

I'm trying to write my first Firefox extension (I use Firefox 8.0.1) and I'm stuck: I have a working sample from https://addons.mozilla.org/en-US/developers/tools/package/ - downloaded file plugin.zip renamed to plugin.xpi seems to be OK. Then I extract it to folder, and without any modification compress it again (using default Ubuntu 10.04LTS context menu package archiver). When I'm trying to install recompressed_plugin.xpi Firefox returns: "This add-on could not be installed because it appears to be corrupt.". What am I doing wrong?

Which compression tools should I use to get it working? How can I determine the internal ZIP type (both files plugin.zip and recompressed_plugin.zip have the same MIME type: Zip archive (application/zip))?

adiog
  • 724
  • 1
  • 7
  • 10

1 Answers1

14

You didn't compress the package correctly - this message means that there is no install.rdf at the top level of your ZIP file. You've probably run zip recompressed_plugin.xpi plugin/ instead of zip recompressed_plugin.xpi plugin/*. To test run unzip -l recompressed_plugin.xpi, it should list install.rdf and not plugin/install.rdf or something like that.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
  • 2
    That was helpful. On my system, the only way to remove the leading directory was to cd into the plugin directory and zip from whithin it: "cd plugin/; zip -r ../recompressed_plugin.xpi ./*" – seren Nov 05 '13 at 16:58