Packaging WebRunner Applications

18 April 2011 by Matthew Gertner - Category: Technical Articles

Probably the most frequent question I’ve been getting about WebRunner is how to package up web apps for distribution to end users. Many creators of Prism apps have been distributing them by creating an installer that places the Prism runtime (basically the entire Prism directory) and web app configuration files on the end user’s machine. The good news is that the procedure for installing WebRunner apps is similar. The main difference is that the runtime is now Firefox instead of Prism. Follow the procedure described below to package up the web app files and runtime. Note that this is not “for dummies” and I’m assuming that you are a smart, good-looking and personable developer who knows their way around the Firefox files on their hard disk.

Windows and Linux

Create a staging directory for your app, and copy in the WebRunner stub (“webrunner.exe” on Windows and “webrunner” on Linux) and “application.ini” file (you can find them in the “stub” subdirectory of the WebRunner extension in your Firefox profile directory). Edit “application.ini” to remove the GRE_HOME entry. Create a subdirectory under the staging directory called “xulrunner” and copy in the entire contents of your Firefox directory. On the target machine, you’ll need to install the staging directory somewhere (e.g. “C:Program FilesWebRunner AppsMyApp”) and also copy over the web app home directory (generally under “%APPDATA%/WebApps” on Windows and “~/.webapps” on Linux), perhaps into a subdirectory called “webapp” of the directory where you put the stub.

You’ll need to create a shortcut that runs the stub with a -webapp parameter, followed by the full path to the web app home directory (e.g. “C:Program FilesWebRunner AppsMyAppwebapp”). Now we’re almost done, but skip down to the section called “All platforms” for the final step.

Mac

Thinking different? Good, because on Mac the installation procedure is quite different as well. In the app bundle created by WebRunner for your app (e.g. “MyApp.app”), create a new subdirectory under “Contents” called “Frameworks”. Inside that, create another subdirectory called “XUL.Framework”. Copy the entire contents of “Firefox.app/Contents/MacOS” into it. Now edit “MyApp.app/Contents/Resources/application.ini” and remove the GRE_HOME line. See, Mac really is easier! But keep reading since you need to install the WebRunner extension as well.

All platforms

So far, we’ve basically done the same thing as we would have when packing up Prism apps. There is one big difference, however: Prism had all its special single-site browser magic baked in, whereas what we just set up is just plain vanilla Firefox and some web app config files that Firefox knows nothing about. For this to work, the WebRunner extension has to be installed. The easiest way to do this is to copy the extension directory (generally “webrunner@salsitasoft.com” in the “extensions” subdirectory of your Firefox profile directory) into the “extensions” directory of the Firefox runtime (i.e. under “xulrunner” on Windows and Linux, under “Contents/Frameworks/XUL.Framework” on Mac). Now open up your “application.ini” again and remove the XRE_PROFILE_PATH line. Also change the Name value in the [App] section to the name of your app, and add a Vendor value under it if you want one (this will determine where the user’s profile directory is created).

Now you just have to create an install program to copy the whole staging directory (or Mac app bundle) onto the end user’s disk. Inno Setup is a good way to do this on Windows. On Mac, a DMG file is generally used. On Linux, you can just distribute a tar file since everyone who uses Linux is super technical and debugs device drivers in their spare time.

The good news

I’m currently working on a packager for WebRunner that will do all of the above automatically, so consider these instructions a stopgap measure until it is finished.


« - »
COMMENTS
  • http://Website Vojta7

    I’d like to let WebRunner get its older name Prism. I think it’s better.

  • http://Website Joe

    Really great news hope that you keep developing it. One of the most useful extensions around and a great app, I use it a lot.

  • http://www.cornerstonenw.com Peter Rust

    > I’m currently working on a packager for WebRunner
    > that will do all of the above automatically
    Any progress? AFAIK, this is the only project that really brings HTML5 to a stand-alone app (chromiumembedded’s HTML5 functionality isn’t very stable because they have to re-implement a lot of the glue code, chromeless is XULRunner-based, not FF-based)

    • Sanjib

      Could you send me a copy of Web Runner application in sanjibchk@gmail.com as not downloadable now

  • http://www.salsitasoft.com/ Matthew Gertner

    I have an internal version of the packager. Send me a mail and I’ll get you a copy. I haven’t had a chance to finalize it partly because of too much other work and partly because I’m still deciding exactly how to handle this from a business perspective. In any case, this blog post seems to have taken most of the pressure off since it’s not too hard to “roll your own”.

  • Pingback: Create your own app from a website | Damien Loughery

  • Pingback: Package a WebRunner application in 8 steps | ASTUTEQ.de

  • http://www.astuteq.de Stefan

    Hello,

    thanks for this great extension.

    I had some problems to get a working application with this guide. But I got it finally working and I wrote my own guide for internal use. Maybe this guide can help other people, too! Here is the link:

    http://www.astuteq.de/blog/2011/07/26/package-a-webrunner-application-in-8-steps/

  • Pingback: Just Browsing: Packaging WebRunner Applications… For Dummies! | Firefox Latest News

  • http://Website David M

    Is there any chance you have uploaded the packager yet? This is awesome and I’m happy to pay for it immediately because I’m not quite able to use the instructions to replicate the app locally so it’s portable.. I just get a firefox (5.0) browser opening etc.. (grovelling, begging)

  • http://www.facebook.com/profile.php?id=675191174 Timothy Lee Rayner

    Is Webrunner only going to be running as a Firefox extension? What I liked about Prism was the concept of running a cut-down Chromeless Browser to use as a front end for web based apps (as a side note why the HECK did Google have to call their browser Chrome – they must know that “Browser Chrome” was an accepted term for the non-page part of the browser, grr).

    How does this work as an extension – can I still launch a webpage from a desktop item or startup script without having to put up with the needless address bars & browser buttons?

    Also I’m hoping the Linux support is better than it was at the end of Prism.