Installing plugins to Gecko embedding browsers on Windows

This document presents the Windows Registry keys plugin installers can parse to determine where to install a given plugin (for Mozilla browsers) on Windows. Since the prospect of embedded Gecko browsers raises the scenario of more than one Gecko-based browser that a Netscape-style plugin can work with, it becomes important to let plugin developers know how to discover these browsers on a Windows machine.

This information applies to Mozilla based browsers that pull the Mozilla codebase after the Mozilla 0.9.1 milestone release. None of the Registry keys mentioned here are written by browsers before the Mozilla 0.9.1 timeframe. For example, Netscape 6.0 and 6.01 do not write any of these keys into the Registry, and thus these keys are not available for plugin vendors to parse for these two browsers. Netscape 6.1 and onwards, however, will write these keys, and so creating a plugin installer that puts the shared object (DLL) in the right place becomes much easier, since the relevant meta-information is present in the Win32 System Registry. These keys are written by the installer of Mozilla browsers -- the Netscape 6.2 installer, for example, writes these keys to the registry, and so does the Mozilla installer (for versions after Mozilla 0.9.1). Other major commercial browsers based on Gecko have committed to providing these keys as well. Some Gecko-based browsers provide additional information via the registry, and where appropriate, these registry keys are also mentioned, with the necessary version caveats.

Much of this registry data follows as a consequence of the discussions in bug 109402.

To find the plugins directory

Applicable to Netscape 6.1, 6.2.x, Netscape 7.0 (and up), Mozilla 1.0, and CompuServe 7.0

This section details the suggested mechanism to find out where to install the plugin DLL so that it is picked up by Mozilla based browsers on the desktop.

  1. Go to HKEY_LOCAL_MACHINE\Software\Mozilla
  2. Caveat Emptor: If the Mozilla subkey is not present under HKEY_LOCAL_MACHINE, look under HKEY_CURRENT_USER\Software\Mozilla\. On Windows XP and Windows 2000, in order to write to the registry, sometimes the software may need Administrator privileges. Thus, some Mozilla based browsers, such as the Netscape 6 installer, write to the HKEY_CURRENT_USER key in addition; this doesn't require Administrator privileges. Traditionally, HKEY_CURRENT_USER is a copy of everything in HKEY_LOCAL_MACHINE. The Mozilla subkey is written under HKEY_CURRENT_USER\Software also. However, always look at HKEY_LOCAL_MACHINE first.
  3. Enumerate the Mozilla subkey. Here you will find keys on a per-product basis. You can enumerate the application subkeys, e.g. HKEY_LOCAL_MACHINE\Software\Mozilla\Productx.y\. The keys "Product x.y" contain application keys for the given Mozilla based browser. Example: Netscape 6 6.1\
  4. Look at the Extensions subkey, e.g. HKEY_LOCAL_MACHINE\Software\Mozilla\Netscape 6 6.1\Extensions\
  5. Access the Plugins value and value-data pair, e.g: Plugins = C:\Program Files\Netscape\Netscape 6\Plugins. You also have the Components value and value-data pair; this is for XPCOM components. In addition, if you have made your plugin scriptable and accessible from JavaScript, you ought to put the associated XPT file in the Components directory. You can access the Components value and value-data pair (telling you where the Components directory is) in a similar manner, e.g.: Components=C:\Program Files\Netscape\Netscape 6\Components. Future Mozilla based browsers won't distinguish between plugins and components, and will pick both up from a common location. However, for Netscape 6.1 and Netscape 6.2, XPT files, as well as XPCOM Plugins, ought to go in the Components directory. On these browsers, this is the only directory that can "pick up" an XPT file, as well the only directory that can recognize XPCOM components.
  6. You now have information about the Plugins directory for Gecko embedding browsers. Examples given for "Product x.y" were using Netscape 6 but other possible Mozilla based browsers exist as well; all Gecko-based browsers are encouraged to write these keys, so that plugin vendors can write plugin installers that install correctly to all Gecko-based browsers.

To find the path to the browser executable (EXE)

Applicable to Netscape 6.1, 6.2.x, Netscape 7.0 (and up), Mozilla 1.0, and CompuServe 7.0

Finding the browser executable is useful if you wish to launch the browser following installation of the plugin DLL.

  1. Go to HKEY_LOCAL_MACHINE\Software\Mozilla
  2. Caveat Emptor: If the Mozilla subkey is not present under HKEY_LOCAL_MACHINE, look under HKEY_CURRENT_USER\Software\Mozilla\. On Windows XP and Win2000, in order to write to the registry, sometimes the software may need Administrator privileges. Thus, software such as the Netscape 6 installer writes to the HKEY_CURRENT_USER key additionally, which doesn't require Administrator privileges. Traditionally, HKEY_CURRENT_USER is a copy of everything in HKEY_LOCAL_MACHINE. The Mozilla subkey is written under HKEY_CURRENT_USER\Software also. However, always look at HKEY_LOCAL_MACHINE first.
  3. You can enumerate the application subkeys, e.g. HKEY_LOCAL_MACHINE\Software\Mozilla\Product x.y\. The keys "Product x.y" contain application keys for the given Mozilla based browser. Example: Netscape 6 6.1
  4. Look at the bin\ subkey, e.g. HKEY_LOCAL_MACHINE\Software\Mozilla\Netscape 6 6.1\bin\
  5. Access the PathToExe value and value-data pair, e.g: PathToExe=C:\Program Files\Netscape\Netscape 6\netscp6.exe
  6. You now have information about the location of the EXE on Windows for Gecko embedding browsers. Examples given for "Product x.y" were using Netscape 6, but other possible Mozilla based browsers exist as well; all Gecko-based browsers are encouraged to write these keys, so that plugin vendors can write a plugin installer that is able to find the information it needs across all Gecko-based browsers.

To find the version of Gecko used (for plugin compatibility)

Applicable to CompuServe 7.0, Netscape 7.0 (Windows), and other AOL browsers currently in beta only

Finding the version of Gecko that the browser uses is useful, because plugin vendors may wish to take advantage of certain features (perhaps available via fixes to the Netscape Plugin API) that are only available in certain versions of Gecko. This information is written by a select group of installers, as mentioned above.

  1. Go to HKEY_LOCAL_MACHINE\Software\Mozilla
  2. Caveat Emptor: If the Mozilla subkey is not present under HKEY_LOCAL_MACHINE, look under HKEY_CURRENT_USER\Software\Mozilla\. On Windows XP and Win2000, in order to write to the registry, sometimes the software may need Administrator privileges. Thus, software such as the Netscape 6 installer writes to the HKEY_CURRENT_USER key additionally, which doesn't require Administrator privileges. Traditionally, HKEY_CURRENT_USER is a copy of everything in HKEY_LOCAL_MACHINE. The Mozilla subkey is written under HKEY_CURRENT_USER\Software also. However, always look at HKEY_LOCAL_MACHINE first.
  3. You can enumerate the application subkeys, e.g. HKEY_LOCAL_MACHINE\Software\Mozilla\Product x.y\. The keys "Product x.y" contain application keys for the given Mozilla based browser. Example: [HKEY_LOCAL_MACHINE\\Software\\Mozilla\\CompuServe 7.0]
  4. Look at the GeckoVer string value found there, and ascertain its value, e.g. under [HKEY_LOCAL_MACHINE\\Software\\Mozilla\\CompuServe 7.0] you will see "GeckoVer"="0.9.4.2". The GeckoVer string value deterimines what milestone of Mozilla the browser is built against. Additional Example: under [HKEY_LOCAL_MACHINE\\Software\\Mozilla\\Netscape 7.0] you will see "GeckoVer"="1.0.0.0". The value 1.0.0.0 suggests that Netscape 7.0 is built against Mozilla 1.0.

Additional registry information

Applicable only to CompuServe 7.0 and other AOL browsers currently in beta only

Certain other keys may be of use to plugin vendors, but these keys are written mainly by CompuServe and other browsers by AOL (based on Mozilla) which are only in beta currently. These keys are discussed in bug 109402#c8, Comment 8.

We can use CompuServe 7.0 as an example of these additional keys. Under HKEY_LOCAL_MACHINE\Software\Mozilla\CompuServe 7.0 you'll find:

  • "Plugins Folders"="C:\\Program Files\\Common Files\\csshare\\plugins0942"
  • "Product"="CompuServe"
  • "Version"="7.0"
  • "DisplayName"="CompuServe 7.0"

The Product, Version, and DisplayName string values are currently only written by CompuServe 7.0, and they are written alongside the GeckoVer string value.

Original Document Information

  • Last Updated Date: June 18, 2002
  • Copyright Information: Portions of this content are © 1998–2006 by individual mozilla.org contributors; content available under a Creative Commons license

Document Tags and Contributors

Contributors to this page: Spanglerco, trevorh
Last updated by: trevorh,