XML
  Home arrow XML arrow Page 4 - Creating an XUL App Installer
IBM developerWorks
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Creating an XUL App Installer
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2006-05-22

    Table of Contents:
  • Creating an XUL App Installer
  • Getting Started
  • The Installation Process
  • Packaging Your Files

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Creating an XUL App Installer - Packaging Your Files


    (Page 4 of 4 )

    To package your installation files into an XPI file, you can use standard archiving applications such the popular WinZip or WinRAR.  You simply need to select the option to create a new archive, select an appropriate name that ends with .XPI then set the Files of Type listbox to All Files.  Now choose the files to be packaged and hey presto! Your XPI archive should now exist. 

    As you'll need to have a directory structure within the XPI file, I'd recommend using WinRAR as it is easier to create relative folder paths to set up the internal structure of the archive.  Ensure that you set the archive type to Zip however, and not RAR or it won't work; when you try to install it, you'll get an error message stating "Not a valid installation package."  Note that the JAR file inside the XPI archive must also be in ZIP format or the application won't work after the install. Once this has been done, your XPI package should appear like this:

     

    The JAR file should contain folders for each element of the package, in this case, the content and locale directories:

     

    Each of these folders should contain the relative paths to the application files:

     

    Once your application is packaged, there is very little else that needs to be done; you just need to focus on deployment now, which is likely to be via a web page.  To run the XPI file, all you need to do is create a hyperlink to it; when the hyperlink is selected with a Mozilla browser, the installation process will begin:

    Click the following link to install XULEditLite: <a href="xuleditlite.xpi">Install</a>

    This is all you need.  Mozilla will handle the confirmation or error reporting, giving you either a success dialog when the installation is complete or an error message if things go wrong. The default, unconfigured messages don't provide much information however, so it is advisable to create your own alerts, such as one that informs the user that Mozilla will need to be restarted before the new application will be available.  It may also be wise to inform users that your application (if it is anything like this one) is best run stand-alone, and therefore, should perhaps also contain instructions on how to do this.

    I like to run my XUL application as a stand-alone application in its own window, rather than within Mozilla itself.  Mozilla still powers my program; it just doesn't display anything on screen.  The only problem that I've found with this is that I have to open a command window and type out a command that will launch my application every time I want to use it.  One way that I've got around this is to create a batch file, which is pretty much just the same command to launch the program typed into a text file and saved with a .bat extension.  Linux users will know these files as shell scripts.

    Add the following code to a text file and save it appropriately:

    START mozilla -chrome chrome://interface/content

    This will effectively create an executable that will launch your application without the need for manual intervention.  As part of the installation process, it would be relatively simple to assign this file to be installed to the desktop instead of the chrome directory to go that extra mile for the end user.

    So you have seen how easy it is to package and create an installer for a XUL application that you have written. You'll find that knowing about packing makes things easier when creating skins as well, as downloadable skins for Mozilla or other XUL applications are also packaged in this way and installed using XPInstall. All in all, the various elements that make up the packaging and installation medium are an excellent way of going about things.  Everything is open source and relatively straight forward.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hi everyone,Hope you enjoy this article, again this is one of the easier aspects...
     

    XML ARTICLES

    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands
    - Creating an XUL App Installer
    - Overlays in XUL
    - Skinning Your Custom XUL Applications







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway