eBlogzilla

Friday, January 4, 2013

How to specify unpack option in Addon SDK

Everyone thinks that it should be really easy to specify unpack option for your extension using Firefox Addon SDK. But it is not so easy as it looks at the first glance. Addon SDK has no such command line option.

So you've two ways to do that:

1. You can edit this file: %ADDON_SDK_HOME%\python-lib\cuddlefish\app-extension\install.rdf. In this file just find the next line:
<em:unpack>false</em:unpack>
and change to
<em:unpack>true</em:unpack>
After that all extensions compiled with Addon SDK will have unpack option set to true.

2. If you need to compile only one extension with this option specified to true then you'll need to perform bit more work. You need to edit __init__.py and rdf.py files in %ADDON_SDK_HOME%\python-lib\cuddlefish folder. That should be quite easy to do. Just search for "update_url" term in these files and see how exactly this option is implemented. After a couple of minutes you should be able to add your own options to the command line of Addon SDK.