如何用7Zip创建xpi文件? [英] How to create xpi file with 7Zip?

查看:349
本文介绍了如何用7Zip创建xpi文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打包我的Firefox扩展为xpi文件。我尝试了将它加入到档案中,并将其命名为filename.xpi。但是,当我尝试在Firefox上安装它时,我得到包损坏的消息。有没有什么办法可以创建一个有效的xpi文件?

我已经安装了cygwin,并试图执行zip命令来创建xpi文件。但得到的zip不是一个命令错误。



有人可以指导我完成它吗? 如果你在windows上安装cygwin,你可以使用内置的工具:


  1. 选择内容(请记住,不要选择外部文件夹)。
  2. 右键单击

  3. 发送到

  4. 压缩(压缩)文件夹

然后只需替换文件名中的.xpi .zip

看起来您的问题正确地完成了要点1.只选择扩展的内容。不是包含它的文件夹。

所以基本上你的zip文件应该具有以下结构:

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

而不是这个结构:

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


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 ?

解决方案

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>

这篇关于如何用7Zip创建xpi文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆