\
Source Code
Commands
RegistryImport
| The "RegistryImport" Command |
This command is used to import a ".reg" file in "REGEDIT4" format.
This sort of file can be
created by "REGEDIT.EXE".
This command is handy if you wish to perform the translation for
every build (perhaps someone supplies the REGEDIT4 file to you as a way of
supplying updates), however if it is a once off process and you'd like to do it
once (and/or the contents includes values you need to "tweek") then have a
look at the "Registry Conversion" section of this document.
This command takes these parameters:
- File Name (positional)
Name of the ASCII formatted file.
Its first line must be "REGEDIT4".
Although a "Windows Registry Editor Version 5.00" formatted
file might look very similar at a glance there are major differences,
do not be tempted to hand edit the first line to "REGEDIT4"
(although this might work for simple string or dword values)!
- CLASSES_ROOT (optional)
This parameter must be supplied to import "CLASSES_ROOT" registry entries (otherwise they will be ignored). If the value supplied is blank then a component will be created to hold the relevant registry entries (assuming any exist) otherwise they will be added to the component name you supplied.
- CURRENT_USER (optional)
This parameter must be supplied to import "CURRENT_USER" registry entries (otherwise they will be ignored). If the value supplied is blank then a component will be created to hold the relevant registry entries (assuming any exist) otherwise they will be added to the component name you supplied.
- LOCAL_MACHINE (optional)
This parameter must be supplied to import "LOCAL_MACHINE" registry entries (otherwise they will be ignored). If the value supplied is blank then a component will be created to hold the relevant registry entries (assuming any exist) otherwise they will be added to the component name you supplied.
- SpecialFolderTranslations (optional)
The data being imported may have hard coded references to locations that may vary on different peoples computers, which is why you generally use "system folder properties" instead of a directory such as "c:\winnt". Due to Windows Installer limitations not all such references can be handled so "c:\winnt\" will be translated but "c:\winnt" will not be.
The default for this parameter can be set via the DEFAULT_REGISTRYIMPORT_SPECIALFOLDER_TRANSLATIONS macro. The initial value for this is "Y".
It is possible to alter the import configuration. See "ImportTranslations.mmh" for more information, the following worked for one user:
#(
<$ImportTranslationAdd
FromExp=^'C:\Program Files\MyTopDir\'^
ToExp=^'[INSTALL_BASE_FOLDER]'^>
>
#)
If a component is created for you then it will be created in the
"current" feature with default options
(see the "Component" command).
The following command imports registry entries, creating all required
components:
<$RegistryImport "test.re4" CURRENT_USER="" LOCAL_MACHINE="" CLASSES_ROOT="">