Successfully embedding the GRE requires that information about installed GREs be stored on the system. This information is stored differently on each operating system. This document describes the registration mechanism.
On windows, GRE registration information is kept in the win32 registry under the HKEY_LOCAL_MACHINE/Software/mozilla.org/GRE and HKEY_CURRENT_USER/Software/mozilla.org/GRE keys. Each subkey is searched for GRE registration information:
HKLM/Software/mozilla.org/GRE/1.8_1 Version=1.8 GreHome=C:\path\to\installed-dir Feature=Value Feature2=Value2 HKLM/Software/mozilla.org/GRE/1.8_2 Version=1.8 GreHome=C:\path\to\second-installation
When installing a GRE via the Mozilla suite GRE installer, the installer will blindly overwrite any previous GRE information in HKLM/Software/mozilla.org/GRE/<version>.
When installing a GRE via the command line <tt>xulrunner.exe -register-global</tt>, XULRunner will detect that there is already an installation at HKLM/Software/mozilla.org/GRE/<version> and will try alternate keys <version>_1 _2 until an available key is found.
On mac, the only GRE is the libxul framework XUL.framework. This framework is installed either in /Library/Frameworks/XUL.framework/Versions/<version> or in ~/Library/Frameworks/XUL.framework/Versions/<version>.
On linux, registration information is kept in INI-style files of the following form:
[1.7.10] GRE_PATH=/usr/lib/mozilla-1.7.10 Feature=Value Feature2=Value2
These INI files can be in any of the following locations:
/etc/gre.conf /etc/gre.d/*.conf ~/.gre.conf ~/.gre.d/*.conf
Mozilla has never officially shipped a linux GRE based on the Mozilla suite. However, some linux distributors including Red Hat/Fedora Core ship /etc/gre.d/*.conf files with the Mozilla suite RPMs.
XULRunner RPMs/post-install scripts should register XULRunner as a GRE by running <tt>xulrunner -register-global</tt> and not hand-create a .conf file. The <tt>-register-global</tt> flag has special fallback semantics so that multiple XULRunners of the same version can be installed without overwriting registration files.