AddReg

The AddReg key, under the [DefaultInstall] section, is required and describes the keys and values that the .cab file adds to the device registry.

[add_registry_section]
registry_root_string, subkey,[value_name], flags, value[,value]
[registry_root_string, subkey,[value_name], flags, value[,value]]

Parameters

  • registry_root_string
    String that specifies the registry root location. The following table shows the values that are supported by Windows CE.
    Root string Description
    HKCR The same as HKEY_CLASSES_ROOT
    HKCU The same as HKEY_CURRENT_USER
    HKLM The same as HKEY_LOCAL_MACHINE
  • value_name
    This is the registry value name. If empty, the "(default)" registry value name is used.
  • flags
    This contains a numeric value that specifies information about the registry key. The following table shows the values that are supported by Windows CE.
    Flag Value Description
    FLG_ADDREG_NOCLOBBER 0x00000002 If the registry key exists, do not overwrite it. This flag can be used in combination with any of the other flags in this table.
    FLG_ADDREG_TYPE_SZ 0x00000000 The REG_SZ registry data type.
    FLG_ADDREG_TYPE_MULTI_SZ 0x00010000 The REG_MULTI_SZ registry data type. The value field that follows can be a list of strings separated by commas.
    FLG_ADDREG_TYPE_BINARY 0x00000001 The REG_BINARY registry data type. The value field that follows must be a list of numeric values separated by commas, one byte per field, and must not use the 0x hexadecimal prefix.
    FLG_ADDREG_TYPE_DWORD 0x00010001 The REG_DWORD data type. Only the non-compatible format in the Win32 Setup .inf documentation is supported.

The following code example sets a sample application version number, using "alpha" as the "(default)" registry value. It also sets test equal to 3, and new and another equal to 6.

[DefaultInstall]
AddReg = RegSettings
[Strings]
reg_path = Software\Company\AppName

[RegSettings]
HKLM,%reg_path%,,0x00000000,alpha
HKLM,%reg_path%,test,0x00010001,3
HKLM,%reg_path%\new,another,0x00010001,6

See Also

Creating an .inf File | CAB Wizard Overview | CAB Wizard Syntax

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.