Package a XPI file

Author: 
Luke Tarplin

To Create an XPI File suitable for Mozilla extensions and addons, as well as other applications requiring a similar packaging follow these basic steps.if you are creating a Mozilla addon or extension you should have a version of chrome.manifest ready for compiling with any content overlays or skins pointing to the correct jar.

  1. Open up a terminal or command line application.
  2. Change Directory to the "Chrome" directory within the main project, eg: sample/chrome.
  3. While running as Super User/Administrator type zip -r sample.jar content/* skin/*
  4. Once the Jar file has been created type cd .. to get back to the root of the sample project, eg: sample.
  5. Type zip sample.xpi * to package all the files into a *.xpi or to package only the compiled files type zip sample.xpi install.rdf chrome.manifest chrome/sample.jar

You should now have a fully packaged XPI file, to test the xpi you can use a tool such as Winzip or 7zip to extract the files and folders.If the files within are for a Mozilla extension or addon, you can use the target platform to install the XPI.To install a packaged XPI in Mozilla Firefox you need to click File -> Open File & browse to the location of the XPI. The Mozilla installer should then popup and you should follow the on screen instructions. 

Valid XHTML 1.0 Strict