Difference between revisions of "How to do an application using XULRunner"

From CDOT Wiki
Jump to: navigation, search
(Setting up the chrome.manifestj file)
m
Line 93: Line 93:
  
 
   content myapp file:content/
 
   content myapp file:content/
 
'''References:'''
 
*[http://blogs.acceleration.net/ryan/archive/2005/05/06/1073.aspx]
 
*[http://developer.mozilla.org/en/docs/Getting_started_with_XULRunner]
 
*[http://developer.mozilla.org/en/docs/XULRunner:Deploying_XULRunner_1.8]
 
*[http://developer.mozilla.org/en/docs/XUL_Application_Packaging XUL Application Packaging]
 
  
 
== Setting up the prefs.js file ==
 
== Setting up the prefs.js file ==
Line 107: Line 101:
  
 
== Running the application ==
 
== Running the application ==
 +
 +
 +
== References ==
 +
*[http://blogs.acceleration.net/ryan/archive/2005/05/06/1073.aspx]
 +
*[http://developer.mozilla.org/en/docs/Getting_started_with_XULRunner]
 +
*[http://developer.mozilla.org/en/docs/XULRunner:Deploying_XULRunner_1.8]
 +
*[http://developer.mozilla.org/en/docs/XUL_Application_Packaging XUL Application Packaging]

Revision as of 21:50, 22 October 2006

Note: This page is still under construction

Setting up an application file structure

First set up the application file structure to the following:

 /applicationName
   /chrome
     /applicationName
       your app files
     chrome.manifest
   /defaults
     /preferences
        prefs.js
   application.ini

This file structure is used on a Linux platform. If your using a different platform, please visit Deploying XULRunner 1.8 to find the file struture for your specific platform.

Notes:

Users can change the name of the italicized filename and folders

Setting up the application.ini file

XULRunner first looks at the application.ini file located at the root directory. This file contains metadata which tells XULRunner how to run the application properly. This fype typically contains [Heading] and Key=Values. Also, Lines which begin with characters "#" or ";" are treated as comments.

The application.ini file contains two sections. They are the following with surrounding square brackets:

[App] Section - This section of the file contains data about the application

Key Value
Name Name of the application.
Version Version of the application.
BuildID This is the build ID which is unique. Typically this field is a date
ID Unique ID of the application.
Vendor This is the vendor of the application which is an optional field.


[Gecko] Section - This section contains information about what version XULRunner is needed for the application.

Key Value
MinVersion The minimum XULRunner version this application supports.
MaxVersion The maximum XULRunner version this application can run on.


The following is a sample application.ini file.

 [App]
 Vendor=Mylau
 Name=Hello World Application
 Version=1.0
 BuildID=20060101
 Copyright=Copyright (c) 2006 
 ID=xulTestApp@mylau.org
 
 [Gecko]
 MinVersion=1.8
 MaxVersion=1.8

Setting up the chrome.manifest file

The chrome manifest is used by XULRunner to locate the application resources. The application can be distributed using a compressed JAR file. For this example, the chrome.manifest file contains the following:

 content myapp file:content/

Setting up the prefs.js file

Creating some XUL

Running the application

References