Creating an XUL App Installer - Getting Started
(Page 2 of 4 )
I'll be using the application created in the last XUL series as an example for this installer. If you're not, you'll need to adjust the file names and stuff accordingly, but the basic premise should be the same.
You will know from looking at the source files of Mozilla that most of the files needed to run any of the applications of the Mozilla suite are packed into JAR, or Java Archive, files. These archives then contain the standard directory structure of working XUL applications, making use of content, locale and skin folders. This means that your XPI file can be made up of just two files: the JAR file containing all of the XUL, RDF and other associated files, and the special JavaScript file that controls the install process.
This JavaScript file must be called install.js and is a surprisingly small and simple file when used with relatively small and simple applications. We will look at how to construct this file now. As usual when working with XUL, you'll need nothing more complex than a text editor at this point.
First, we need to set a few variables:
appName = "XUL Edit Lite";
author = "Dan Wellman";
chromeName = "interface";
version = "1.0";
These variables represent information also found in the contents.rdf file located with your main application file. Next, create a variable to hold the name of the file that will be copied to the user's system:
file = "xuleditlite.jar";
Finally, we can save time later by creating variables to hold the information to be written to the installed-chrome file:
contentPath = "content/"+chromeName+"/";
localePath = "locale/en-US/"+chromeName+"/";
Next: The Installation Process >>
More XML Articles
More By Dan Wellman