Adding Extensions using the Windows Registry

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.
本文说明如何使用Windows注意表"安装"Firefox/Thunderbird extensions. 此机制用以方便第三方为Firefox/Thunderbird注意extensions.

Note The mechanism described in this document requires Firefox/Thunderbird 1.5 or later.
注意 此机制要求Firefox/Thunderbird 1.5或者更高版本.

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.:
VendorName的值可由相对应的nsIXULAppInfo属性得到. 在Mozilla产品中, Vendor的值为"Mozilla", Name为产品的短名称, 例如:

HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions
HKEY_CURRENT_USER\Software\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.
Extension的ID必须作为注册项的名字. 注册项的类型必须为REG_SZ, 值必须是包含extension的文件夹的绝对路径. 例如, 要安装Building an Extension文章中的extension, 创建名为sample@foo.net的注册项, 设定其值为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.
注册项创建完成后, 在下一次启动时Firefox/Thunderbird将会注意到变化. 在Firefox/Thunderbird运行期间也可以安全地修改注册项.

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.
如果HKEY_CURRENT_USERHKEY_LOCAL_MACHINE下有相同的extension, 那么HKEY_CURRENT_USER将被先行使用. 如果用户目录下有相同extension, 那么它将优先于任何注册项.

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.
由Windows注册表安装的extensions可简单的进行相应注册项的删除完成卸载. 注册项删除后, 在下一次启动时Firefox/Thunderbird将会注意到变化. Firefox/Thunderbird运行期间也可安全的修改注册表.

See also 参见

打包extension

Document Tags and Contributors

标签:
Contributors to this page: Duwei, Mgjbot
最后编辑者: Mgjbot,