Thursday, July 31, 2008

XULRunner --install-app command line options

Sometimes command line options are a bit hard to "get". They are even worse when the help is vague. I just ran into this and couldn't find anyplace online that described how this command actually worked. I'm posting this here just as a quick ref for me and anyone else how has wondered about the --install-app flag of the xulrunner-bin.

Here is the help that comes with the XULRunner:

chimera-lite% /Library/Frameworks/XUL.framework/xulrunner-bin
Mozilla XULRunner 1.9

Usage: xulrunner [OPTIONS]
xulrunner APP-FILE [APP-OPTIONS...]

OPTIONS
--app specify APP-FILE (optional)
-h, --help show this message
-v, --version show version
--gre-version print the GRE version string on stdout
--register-global register this GRE in the machine registry
--register-user register this GRE in the user registry
--unregister-global unregister this GRE formerly registered with
--register-global
--unregister-user unregister this GRE formely registered with
--register-user
--find-gre Find a GRE with version and print
the path on stdout
--install-app [ []]
Install a XUL application.

If you just run it like this:

/Library/Frameworks/XUL.framework/xulrunner-bin --install-app .

It is going to drop your app in a folder in /Applications with an id of "Vendor" as specified in your application.ini. What do you do if you want it to create your app in another place or even create the installed app with a difference name other than the "Name" configured in application.ini.

Here is an example:

chimera-lite% /Library/Frameworks/XUL.framework/xulrunner-bin --install-app . ../../xul foo.app

This will create the program as foo.app in a folder 2 levels up called xul. There you have it, it is as easy as that.