WinReg Object

Parts of this page show the use of the XPInstall API. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. Extension, Theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. In particular plugin developers should see how to package a plugin as an extension.

WinReg

(Windows only)

Windows developers use this object to manipulate the content of the Windows registry.

Overview

This object does not have a public constructor. Instead, you construct an instance of this object by calling the getWinRegistry method of the Install object.

This discussion assumes you are already familiar with the Windows Registry. For information on it, see API documentation for Windows NT or Windows 95.

When you construct a WinReg object, it is set to operate with HKEY_CLASSES_ROOT as its root key. To use a different root key, use the setRootKey method.

Typically values in the Windows Registry are strings. To manipulate such values, use the getValueString and setValueString methods. To manipulate other values, use the getValue and setValue methods.

Reading registry values is immediate. However, writing to the registry is delayed until performInstall is called.