Thursday, July 12, 2012: XULRunner App Development Experience

#thaiWitter has been using the engine in Firefox 3.6 since 2011, and I attempt to roll my own #thaiWitter app in XULRunner.

This blog post describes its experience.

This blog post doesn’t cover how to write XUL applications, you better read about it on the MDN.

This blog post covers about how to run a XUL application on various platform, because XULRunner sometimes like to act very strangely in some platform.

At the time of writing, it’s XULRunner 13.0.2. And the XUL articles on MDN is very outdated.

On The Mac

I started with the Mac platform. I followed the tutorial to create a XUL application. I got all the chrome stuff ready and ready to run the application.

xulrunner `pwd`/application.ini

Didn’t work. --install-app also doesn’t work.

So I think I will have to package an application bundle first to be able to try it out, and that worked.


I followed the steps described in Deploying XULRunner article, to the point of running the app:

./thaiWitter-DEV.app/Contents/MacOS/xulrunner

It complains about library not found and stuff. It turns out that I have to copy (or symlink) all the .dylib files from Frameworks/XUL.Framework/ into the MacOS folder too.

…and finally, it runs, it runs!

So therefore I assembled a build script that packages the application, available here: dtinth/xulrunner-twclient/osx.

Windows

On Windows, however, it’s much more straightforward. Just follow the deploying XULRunner article and everything should work just fine.

To change the icon of the window (by default windows will show the blue globe icon), just add an ico file with the name matching the id property of the window to the chrome/icons/default directory.

So if I have a <window id="tw-main-window">, I’d put my app icon on chrome/icons/default/tw-main-window.ico.

On Windows, I like to distribute my app as a “portable app,” so I also made a batch script that copies stuff to make a runnable app, available here: dtinth/xulrunner-twclient/win.

Linux

Not yet lol

When the linux version is out, I’ll update this post. But I guess that it’s straightforward, just follow the deploy guide and things should work well.