次の方法で共有


Registry File

Makeimg.exe uses registry (.reg) files to establish the registry entries for an OS image. When you cold boot your target device, Filesys.exe uses the .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 .exe 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 possible value types are shown in the following table.

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 not equal to a particular value, use a space and an exclamation point (!) at the end of the line. IF/ENDIF blocks may be nested.

The 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.

To create a registry entry for starting an application in the Windows CE OS, update or add the HKEY_LOCAL_MACHINE\init section of the Project.reg file with the following syntax.

"launchnn"="defined_exe_name"
"dependnn"=hex:xx,yy...

Parameters

  • launchnn
    Defines the order that the .exe file is started, where nn is 00–99. This parameter must be enclosed in double quotation marks (" ").
  • defined_exe_name
    Specifies the name of the file to be started. This parameter must be enclosed in double quotation marks (" ").
  • dependnn
    Assigns a dependency that prevents the defined .exe file from starting until another .exe file is started, where nn is 00–99. This parameter must be enclosed in double quotation marks (" ").
  • hex:xx,yy...
    Defines the hexadecimal number of the .exe file that must be run before the defined .exe file is run. This parameter consists of the hex keyword, a colon, and one or more hexadecimal numbers, one for each byte of hexadecimal data.

To delete a registry key, place a dash (-) before the key name, using the following format.

[-KEY1]

To delete a value, place a dash (-) after the value's equal sign, using the following format.

"ValueName1"=-{Value Type}:{data}

Example

The following example creates several registry keys and values. Registry entries for launching the application Myproc.exe at startup are created, as well as a new key with a default value. If the IMGNOCONDEXAMPLE environment variable is not set, an additional subkey and value are entered into the registry.

[HKEY_LOCAL_MACHINE\init]
"Launch60"="myproc.exe"
"Depend60"=hex:14,00, 1e,00
[HKEY_LOCAL_MACHINE\RegExample]
@=""
IF IMGNOCONDEXAMPLE !
[HKEY_LOCAL_MACHINE\RegExample\ConditionalSubKey]
"MyString"="This is a string"
ENDIF

Remarks

When Makeimg.exe processes all the .REG files to create a single file, any duplicate entries found result in a warning message. The message indicates a duplicate entry in the final .REG file, Default.fdf or System.hiv or User.hiv. The duplication may 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 that is created and stored in the real registry. In the case of the .HIV files, the data contained in it is the last version found during Makeimg.exe.

When support for file or hive-based registries become available, the .REG files can contain additional tags that get processed during Makeimg.exe time. 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
 Ereg dataE; END HIVE BOOT SECTION
Send Feedback on this topic About Sending Feedback