Registry

The Registry command sets or removes registry keys on the managed Pocket PC. This command can be used in a Software package that both installs an application and sets user configuration settings, or it could be used in a Configuration package that is specifically designed to update registry settings.

The Registry command has two formats: one supports entering registry data directly into the script, and the other references registry data that is stored in a separate file included in the package.

Entering registry data directly

The format of the command that supports entering registry data directly into the script is:

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

Where the following arguments are defined:

  • registry_root_string is a string that specifies the registry root location.

Table 1-4 shows the values that are supported by Windows CE.

Table 1-4 Registry root strings 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

  • subkey is the registry key name.

This can be a path delimited by backslash characters ("\"), such as "Software\Symantec\MyApp". It must not start with a backslash.

  • value_name is the registry value name.

If this is empty, the "(default)" registry value name is used.

  • flags is a numeric value that specifies information about the registry key.

Table 1-5 shows the values that are supported by Windows CE.

Table 1-5 Flag values 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.

  • value is the registry key value.

The format of this field depends on the value type as specified in the flags field.

Referencing registry data stored in a file

The format of the command that references registry data that is stored in a separate file included in the package is:

Registry @Registry_Data_Filename  

Where the following argument is defined:

  • Registry_Data_Filename is a file located in the vendor file directory of the package that contains information about the registry key settings

For example, "%vendorfiles%/Registry.dat"

Any name can be used for this file, as long as it matches what is provided in the command line. This file is a simple text file in which each line contains the same registry data information as described for the alternative command format (entering registry data directly into the script).

The following code example shows a typical registry data file:

Script variable reg_path = Software\Company\AppName  
HKLM,%reg_path%,,0x00000000,alpha		; <default> = "alpha" 
HKLM,%reg_path%,test,0x00010001,3		; Test = 3 
HKLM,%reg_path%\new,another,0x00010001,6 ; New\another = 6  

If either form of the command occurs in the post-install script, the keys in the registry data file are created (if they don't already exist) and the values are set as specified. If the command occurs in the post-remove script, the keys specified in the registry data file are deleted from the registry, unless the FLG_ADDREG_NOCLOBBER flag is set for a given key.


More Information