다음을 통해 공유


Registry File (Windows CE 5.0)

Makeimg.exe uses registry (.reg) files to establish the registry entries for a run-time image.

When you cold boot your target device, Filesys.exe uses .reg files to create a default registry. Platform.reg defines the hardware registry settings for the target device, and Project.reg defines the registry settings for the Windows CE-based executable files.

The registry files have the following format.

[KEY1]
"ValueName1"={Value Type}:{data}
"ValueName2"={Value Type}:{data}
[KEY2]
"ValueName1"={Value Type}:{data}
...

You can specify the default value names by using the following format.

[KEY1]
@ = "default value name" 

The following table shows the possible value types.

Value type Format
REG_SZ "my string"
REG_DWORD dword: NNNNN (hex number)

Type is always interpreted as a hex value.

REG_MULTI_SZ multi_sz: "my string", "my string"
REG_BINARY hex: xx,xx,xx,xx ...
HEX hex(xxxxxxxx): xx,xx,xx,xx

The hex(xx) types should correspond to the remaining Microsoft® Win32® registry types.

You can also use IF/ENDIF keywords, which execute a block of registry settings when an environment variable is set or equal to a particular value.

To execute a block of registry settings when an environment variable is not set or is not equal to a specific value, use a space and an exclamation point (!) at the end of the line.

IF/ENDIF blocks can be nested.

IF/ENDIF keywords have the following format.

IF environment variable [= value] [!]
[KEY1]
"ValueName1"={Value Type}:{data}
"ValueName2"={Value Type}:{data}
[KEY2]
"ValueName1"={Value Type}:{data}
...
ENDIF

Use the semicolon (;) to start a line of comments.

The following table shows the tasks you can perform in the registry.

Task Description
Creating a registry entry To create a registry entry, update the registry file using the following syntax.
[Key1]
"ValueName"="Value Type"
Deleting a registry key To delete a registry key, place a dash (-) before the key name, using the following format.
[-KEY1]
Deleting a registry value To delete a value, place a dash (-) after the value's equal sign, using the following format.
"ValueName1"=-

Example

The following code example shows how you can add entries to the registry to create a key with a value set to a string value. In the example, if the IMGNOCONDEXAMPLE environment variable is not set, an additional subkey and value are entered into the registry.

[HKEY_LOCAL_MACHINE\RegExample]
"MyValue"="MyString"
IF IMGNOCONDEXAMPLE !
[HKEY_LOCAL_MACHINE\RegExample\ConditionalSubKey]
"MyString"="This is a string"
ENDIF

Remarks

When Makeimg.exe processes all .reg files to create a single file, duplicate entries result in a warning that indicates a duplicate entry in the final .reg file, Default.fdf, System.hiv, or User.hiv files.

The duplication can be valid in some cases. The OEM should verify the duplication. When the OS cold boots, as in the case of the Default.fdf file, the last version of the duplicated data is the version created and stored in the real registry. In the case of .HIV files, the data contained in it is the last version found during Makeimg.exe.

The hive-based registry requires that .reg files have additional tags included. These tags identify what parts of the registry are contained in the boot hive file. Each registry entry that must be set in the boot hive to boot the device must be wrapped with the following tag.

; HIVE BOOT SECTION
 ... reg data...
; END HIVE BOOT SECTION

See Also

Run-Time Image Configuration Files | How to Create a Device Driver

Last updated on Thursday, February 02, 2006

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.