Search code examples
firefox-addonxpi

How to create xpi file with 7Zip?


I would like to pack my firefox extension as xpi file. I tried by adding it to archive and name it as filename.xpi

But when i try to install it on firefox am getting "package corrupted" message. Is there any way i can create a valid xpi file ?

I have installed cygwin and tried to execute zip command to create xpi file. But got zip is not a command error.

Can somebody guide me to get it done ?


Solution

  • If you are on windows (to install cygwin it looks like you do), you can use the windows built in tool:

    1. Select the contents of the extension (remember, don't select the outside folder).
    2. Right Click
    3. Send to
    4. Compressed (zipped) folder

    Then just replace the .zip for .xpi in the filename

    Looks like your problem is on completing the point 1. correctly. Select only the contents of the extension. Not the folder that contains it.

    So basically your zip file should have following structure:

    my_extension.zip
      |- install.rdf
      |- chrome.manifest
      |- <chrome>
    

    and NOT this structure:

    my_extension.zip
      |- <my_extension>
           |- install.rdf
           |- chrome.manifest
           |- <chrome>