Windows Registry

For those who don’t know too much about the Windows registry, here is some very basic info about it from Wiki.

Windows registry

The Windows registry is a database which stores settings and options for the operating system for Microsoft Windows 32-bit versions, 64-bit versions and Windows Mobile. It contains information and settings for all the hardware, operating system software, most non-operating system software, users, preferences of the PC, etc. Whenever a user makes changes to Control Panel settings, file associations, system policies, or installed software, the changes are reflected and stored in the registry.

The Windows registry was introduced to tidy up the profusion of per-program INI files that had previously been used to store configuration settings for Windows programs. These files tended to be scattered all over the system, which made them difficult to track.

Registry structure

The Registry is split into a number of logical sections, or “keys”. These are generally known by the names of the definitions used to access them in the Windows API, which all begin “HKEY” (an abbreviation for “Handle to Key”); often, they are abbreviated to a three- or four-letter short name starting with “HK” (e.g. HKCU and HKLM).

Each of these keys is divided into subkeys, which may contain further subkeys, and so on. Any key may contain entries with various types of values. The values of these entries can be:
• String Value
• Binary Value (any arbitrary data)
• DWORD Value, a 32 bit unsigned integer (numbers between 0 and 4,294,967,295 [232 – 1])
• Multi-String Value
• Expandable String Value

Registry keys are specified with a syntax similar to Windows’ path names, using backslashes to indicate levels of hierarchy. E.g. HKEY_LOCAL_MACHINESoftwareMicrosoftWindows refers to the subkey “Windows” of the subkey “Microsoft” of the subkey “Software” of the HKEY_LOCAL_MACHINE key. Values are not referenced via this syntax. Value names can contain backslashes which would lead to ambiguities were they referred to this way. The win32 functions that query and manipulate registry values take value names separately from the key path and/or handle that identifies the parent key.

The HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER nodes have a similar structure to each other; applications typically look up their settings by first checking for them in “HKEY_CURRENT_USERSoftwareVendor’s nameApplication’s nameVersionSetting name”, and if the setting is not found looking instead in the same location under the HKEY_LOCAL_MACHINE key. When writing settings back, the reverse approach is used — HKEY_LOCAL_MACHINE is written first, but if that cannot be written to (which is usually the case if the logged in user is not an administrator), the setting is stored in HKEY_CURRENT_USER instead.

HKEY_CLASSES_ROOT

Abbreviated HKCR, HKEY_CLASSES_ROOT stores information about registered applications, including associations from file extensions and OLE object class ids to the applications used to handle these items. On Windows 2000 and above, HKCR is a compilation of HKCUSoftwareClasses and HKLMSoftwareClasses. If a given value exists in both of the subkeys above, the one in HKCUSoftwareClasses is used.

HKEY_CURRENT_USER

Abbreviated HKCU, HKEY_CURRENT_USER stores settings that are specific to the currently logged in user. HKCU mirrors the current user’s subkey of HKEY_USERS.

HKEY_LOCAL_MACHINE

Abbreviated HKLM, HKEY_LOCAL_MACHINE stores settings that are general to all users on the computer. This key is found within the file %SystemRoot%System32Configsystem on NT-based versions of Windows. Information about system hardware is located under the SYSTEM key.

HKEY_USERS

Abbreviated HKU, HKEY_USERS contains subkeys corresponding to the HKEY_CURRENT_USER keys for each user registered on the machine.

HKEY_CURRENT_CONFIG

Abbreviated HKCC, HKEY_CURRENT_CONFIG contains information gathered at runtime; information stored in this key is not permanently stored on disk, but rather regenerated at boot time.

Of course, you can find more info about on the Wiki site but you don’t have to be a registry expert to create portables. To tell you the truth, some info I cited above was new to me also.


What is more important, you should bother only with HKCR, HKCU and HKLM when creating portables.

Now everybody should know what does Windows Registry mean and what sections it has, so let’s continue examining changes in the registry.

One response to “Windows Registry”

  1. wilsont3ch.com » How To Make Portables

    [...] 5. Windows Registry [...]

Leave a Reply