It is surprisingly easy to package and create an installer for a XUL application that you've written. Anyone who uses your application will thank you for it; it will save them a lot of time and effort. Keep reading to see how it's done.
The addFile method assigns a source file to be copied to the target directory. It takes just one parameter; the name of the source file:
You can also use the addFolder method to assign the source files for the installation if your XPI archive contains a directory structure instead of a JAR file.
You now need to specify what information is added to the installed-chrome file, a key element of the chrome-registry. This is done using the registerChrome method which takes three parameters: what to install and how to install it, where the files can be found, and the path to the files:
Note that skin packages normally reside within their own JAR archives, which is why I haven't specified a SKIN| DELAYED_CHROME install. DELAYED_CHROME means that the new chrome will be installed once Mozilla has been restarted (when the chrome.rdf file is regenerated).
Finally, the performaInstall method is called, which actually performs the installation. This is the point where the specified files are actually copied, and the necessary file updates occur: