This information is in my talk slides from earlier in the week, but I’m posting it here to make it more accessible.
bsmedberg has written previously about deploying standalone XUL apps based on XULRunner 1.8 and Installing XULRunner applications. This post expands on the latter, and note it is based on my findings (self discovery and nagging Ben a bit) while working with XULRunner 1.9 (trunk).
Getting the GRE Runtime (XULRunner)
2 Options:
- Download and build from source
- Download a nightly (trunk) build
Application Structure
Entry Point
The application has to know where to start…
2 Options:
- In Preferences
pref(“toolkit.defaultChromeURI“, chrome://mycoolapp/content/start.xul”); - Override the default command line handler with your own.
The preferences file an be called anything and should live in defaults/preferences.
application.ini
The application will not install without this file which contains meta information.
[App]
Vendor=My Company
Name=mycoolapp
Version=1.0
BuildID=20051127
Copyright=Copyright (c) 2005 My Company
[Gecko]
MinVersion=1.8
MaxVersion=1.9a1
Registering the GRE
xulrunner -register-global
This updates the registry on Windows (HKLM\Software\mozilla.org\GRE), and writes to /etc/gre.d on Linux. I don’t know about Mac. One thing I noticed on Windows is that if there is a key entry in the registry for a previous version, installed applications (see below) will not launch. I just deleted the old key and things were hunky dorey.
Deployment 1 – Launching from Flat Structure
xulrunner /path/to/my/application/application.ini
This will launch the application directly from where it is unpacked on the system.
Deployment 2 : -install-app
This command can be used on an application distributed in a flat structure, or an XPI archive (or zip or potentially any recognised compressed file type).
Linux : ./xulrunner -install-app /path/to/my/application.xpi
Installed to /usr/lib/<Vendor>/<Name>/
Mac : /Library/Frameworks/XUL.framework/xulrunner-bin -install-app /path/to/my/application.xpi
Installed to /Applications/<Vendor>/<Name>
Windows : xulrunner.exe -install-app /path/to/my/application.xpi
Installed to c:\Program Files\<Vendor>\<Name>\
If I missed anything, please write about it in the comments here. I have a copy of Chatzilla for XULRunner that is out in the wild, and am porting a couple of extensions over myself. I’m sure there is lots of other good stuff out there. Now it is up to extension authors to port over their work, and developers/companies to seriously consider the platform as a serious contender for their application.

How does one do install-app with a flat structure?
./xulrunner –install-app ./applicationdir/application.ini ?
./xulrunner –install-app ./applicationdir/ ?
Or something else?
Daniel, it’s the first method you list, pointing to application.ini. All that install-app does is copy the files over to the install location, whether they are compressed or not.
Hi,
I still can’t get my application working :(
Can you help me ?
Here is a tar.gz with my xul file.
HelloWorld.xulapp.tar.gz
Thanks for all.
Douglas.
Douglas: On first glance, it appears your chrome.manifest is trying to access a JAR file, while in fact you have flat chrome. I’ll try it out later to confirm what the actual issue is.
Hi,
I’ve corrected that :
In the HelloWorld.xul (I forgot the last “t” of “stylesheet”)
And I changed the chrome.manifest to “content HelloWorld chrome://chrome/content/HelloWorld/
” but it still doesn’t work.
If you have any idea?
Douglas: I believe the chrome.manifest entry should look like this …
content HelloWorld chrome/content/HelloWorld/
Also, your XUL file was missing the XUL namespace
<window id=”sample”
xmlns=”http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul”>
I made all the changes, including the stylesheet one, and tried again but it wouldn’t launch the window. However, something is being launched and the xulrunner process is running. So you are closer. When I have time I’ll try and track it down to the end, unless you beat me there.