mozilla

Revision 59660 of Adding Extensions using the Windows Registry

  • Revision slug: Adding_Extensions_using_the_Windows_Registry
  • Revision title: Adding Extensions using the Windows Registry
  • Revision id: 59660
  • Created:
  • Creator: spike0xff
  • Is current revision? Yes
  • Comment corrected link to 'id' topic on related page.; one or more formatting changes

Revision Content

Introduction

This document explains how to "install" Firefox and Thunderbird extensions using the Windows Registry. This mechanism is designed to make it easier for third-party installers to register extensions with Firefox and Thunderbird.

Installation

Installation is performed by writing a Registry entry under one of the following keys:

HKEY_CURRENT_USER\Software\Vendor\Name\Extensions
HKEY_LOCAL_MACHINE\Software\Vendor\Name\Extensions

Where Vendor and Name are the values returned from the corresponding properties of nsIXULAppInfo. In Mozilla products, Vendor is "Mozilla", and Name is the short name of the product, e.g.:

HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions
HKEY_CURRENT_USER\Software\Mozilla\Thunderbird\Extensions

Or on Windows 7/x64:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Firefox\Extensions
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Thunderbird\Extensions

The ID of the extension must be used as the name of the Registry entry. The Registry entry must have a type of REG_SZ, and its value must be an absolute path to the folder containing the extension (i.e., the location of the unpacked XPI). For example, to install the extension described in the Building an Extension article, create a Registry entry with name equal to sample@foo.net and value equal to c:\extensions\myExtension.

After the Registry entry is created, Firefox/Thunderbird will notice the change the next time it is launched. It is safe to modify the Registry keys while Firefox/Thunderbird is running.

If the same extension appears under both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE, then the instance under HKEY_CURRENT_USER will be used. If the same extension appears in the user's profile directory (via manual install), then it will take precedence over any instances found in the Registry.

Uninstallation

Extensions installed using the Windows Registry may be uninstalled by simply removing their corresponding Registry entry. After the Registry entry is removed, Firefox/Thunderbird will notice the change the next time it is launched. It is safe to modify the Registry keys while Firefox/Thunderbird is running.

Updating

Firefox doesn't automatically notice changes to install.rdf at restart. This is because it checks the modification time of the add-on directory before checking install.rdf. You can force Firefox to notice changes by deleting and recreating the directory, or by touching the modification time of the directory.

Plugins

Plugins seem to follow a somewhat different system, at least with Firefox 9.0 on Windows 7.

Installation can be performed by creating any one of the following Registry keys:

HKEY_CURRENT_USER\Software\MozillaPlugins\plugin-id
HKEY_LOCAL_MACHINE\Software\MozillaPlugins\plugin-id

And on 64-bit Windows:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\plugin-id

Where plugin-id is the id property of the plugin (as in the install.rdf) - for example, x-myplugin@codewell.com

Note: It appears that plugins are loaded from all of these registry keys.

The key must have a value named Path with type REG_SZ, containing the fully-qualified path of the plugin's DLL. The key may have other values, for example Description, ProductName, Vendor, Version, and GeckoVersion.

See also

{{ languages( { "zh-cn": "cn/Adding_Extensions_using_the_Windows_Registry", "zh-tw": "zh_tw/\u4ee5_Windows_\u767b\u9304\u78bc\u5b89\u88dd\u64f4\u5145\u5957\u4ef6", "ja": "ja/Adding_Extensions_using_the_Windows_Registry" } ) }}

Revision Source

<h3 id="Introduction" name="Introduction">Introduction</h3>
<p>This document explains how to "install" Firefox and Thunderbird <a href="/en/Toolkit_API/extIExtension" title="en/Toolkit_API/extIExtension">extensions</a> using the Windows Registry. This mechanism is designed to make it easier for third-party installers to register extensions with Firefox and Thunderbird.</p>
<h3 id="Installation" name="Installation">Installation</h3>
<p>Installation is performed by writing a Registry entry under one of the following keys:</p>
<pre class="eval">HKEY_CURRENT_USER\Software\<em>Vendor</em>\<em>Name</em>\Extensions
HKEY_LOCAL_MACHINE\Software\<em>Vendor</em>\<em>Name</em>\Extensions
</pre>
<p>Where <em>Vendor</em> and <em>Name</em> are the values returned from the corresponding properties of <a href="/en/XPCOM_Interface_Reference/nsIXULAppInfo" title="en/nsIXULAppInfo">nsIXULAppInfo</a>. In Mozilla products, <em>Vendor</em> is "Mozilla", and <em>Name</em> is the short name of the product, e.g.:</p>
<pre class="eval">HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions
HKEY_CURRENT_USER\Software\Mozilla\Thunderbird\Extensions</pre>
<p>Or on Windows 7/x64:</p>
<pre class="eval">HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Firefox\Extensions
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Thunderbird\Extensions</pre>
<p>The <a href="/en/Install_Manifests#id" title="en/Install_Manifests#id">ID</a> of the extension must be used as the name of the Registry entry. The Registry entry must have a type of <code>REG_SZ</code>, and its value must be an absolute path to the folder containing the extension (i.e., the location of the unpacked XPI). For example, to install the extension described in the <a href="/en/Building_an_Extension" title="en/Building_an_Extension">Building an Extension</a> article, create a Registry entry with name equal to <code><a class=" link-mailto" href="mailto:sample@foo.net" rel="freelink">sample@foo.net</a></code> and value equal to <code>c:\extensions\myExtension</code>.</p>
<p>After the Registry entry is created, Firefox/Thunderbird will notice the change the next time it is launched. It is safe to modify the Registry keys while Firefox/Thunderbird is running.</p>
<p>If the same extension appears under both <code>HKEY_CURRENT_USER</code> and <code>HKEY_LOCAL_MACHINE</code>, then the instance under <code>HKEY_CURRENT_USER</code> will be used. If the same extension appears in the user's profile directory (via manual install), then it will take precedence over any instances found in the Registry.</p>
<h3 id="Uninstallation" name="Uninstallation">Uninstallation</h3>
<p>Extensions installed using the Windows Registry may be uninstalled by simply removing their corresponding Registry entry. After the Registry entry is removed, Firefox/Thunderbird will notice the change the next time it is launched. It is safe to modify the Registry keys while Firefox/Thunderbird is running.</p>
<h3 id="Updating">Updating</h3>
<p>Firefox doesn't automatically notice changes to <code>install.rdf</code> at restart. This is because it checks the modification time of the add-on directory before checking <code>install.rdf</code>. You can force Firefox to notice changes by deleting and recreating the directory, or by touching the modification time of the directory.</p>
<h3 id="Plugins">Plugins</h3>
<p>Plugins seem to follow a somewhat different system, at least with Firefox 9.0 on Windows 7.</p>
<p>Installation can be performed by creating any one of the following Registry keys:</p>
<pre class="eval">HKEY_CURRENT_USER\Software\MozillaPlugins\<em>plugin-id</em>
HKEY_LOCAL_MACHINE\Software\MozillaPlugins\<em>plugin-id</em>
</pre>
<p>And on 64-bit Windows:</p>
<pre class="eval">HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\<em>plugin-id</em></pre>
<p>Where <em>plugin-id</em> is the <a href="/en/Install_Manifests#id" title="Install_Manifests#id">id</a> property of the plugin (as in the install.rdf) - for example, <a class=" link-mailto" href="mailto:x-myplugin@codewell.com" rel="freelink">x-myplugin@codewell.com</a></p>
<p>Note: It appears that plugins are loaded from <em>all</em> of these registry keys.</p>
<p>The key must have a value named <code>Path</code> with type <code>REG_SZ</code>, containing the fully-qualified path <em>of the plugin's DLL</em>. The key may have other values, for example Description, ProductName, Vendor, Version, and GeckoVersion.</p>
<h3 id="See_also" name="See_also">See also</h3>
<ul> <li><a href="/en/Extension_Packaging" title="en/Extension_Packaging">Extension Packaging</a></li> <li><a class="internal" href="/en/Installing_extensions" title="en/Installing extensions">Installing extensions</a></li>
</ul>
<p>{{ languages( { "zh-cn": "cn/Adding_Extensions_using_the_Windows_Registry", "zh-tw": "zh_tw/\u4ee5_Windows_\u767b\u9304\u78bc\u5b89\u88dd\u64f4\u5145\u5957\u4ef6", "ja": "ja/Adding_Extensions_using_the_Windows_Registry" } ) }}</p>
Revert to this revision