This is an archived page. It's not actively maintained.

Building a Thunderbird extension 8: packaging

Warning: This content is for older versions of Thunderbird. Much of it may no longer be relevant. See for newer information.

When you are satisfied with how your extension works, package it for deployment and installation.

Zip the contents of your extension's folder (not the extension folder itself), and rename the zip file to have a .xpi extension. In Windows 7, you can do this by selecting all the files and subfolders in your extension folder, right click and choose "Send To -> Compressed (Zipped) Folder". A .zip file will be created for you. Just rename it and you're done!

On Mac OS X, you can right-click on the contents of the extension's folder and choose "Create Archive of..." to make the zip file. However, since Mac OS X adds hidden files to folders in order to track file metadata, you should instead use the Terminal, delete the hidden files (whose names begin with a period), and then use the zip command on the command line to create the zip file. The files are typically of the name .DS_Store.

On Linux, you would likewise use the command-line Zip tool.

 cd ~/extensions/my_extensions
 zip -r ../sample.xpi *

When placed in the (user's profile)/extension directory, Thunderbird will open the xpi, check the id in the install.rdf and create that directory for your package. It will then cd to that directory and unzip the files, thereby creating a mirror of your ~/extensions/my_extension directory structure and files.