MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: /RegistryComment[Next]: RegistryRead
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->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.

Please see the "options for commands" section of the manual for generic configuration details on how these options can be altered:

#define? REGIMPORT_DIE_ON_UNKNOWN_HIVES                Y
#define? DEFAULT_REGIMPORT_SPECIALFOLDER_TRANSLATIONS  Y
#define? REGIMPORT_DEFAULT_COMPONENT_EXP               'REGIMPORT_' || {$HiveVar}

;--- These should contain rexx code, they are passed the NAMES of variables containing the data ---
#define? REGIMPORT_REXXCODE_HOOK_FILELINE_MANIPULATION        ;;Gets passed "LINEVAR", called very soon afrer line from file read.
#define? REGIMPORT_REXXCODE_HOOK_STRING                       ;;Gets passed a STRING's "NAMEVAR" & "VALUEVAR"

This command takes these parameters:

If a component is created for you then it will be created in the "current" feature with default options (see the "Component" command).

EXAMPLE

The following command imports registry entries, creating all required components:

<$RegistryImport "test.re4" CURRENT_USER="" LOCAL_MACHINE="" CLASSES_ROOT="">

An example using hooks:

;--- Replace any tabs with a space ---
#DefineRexx+ 'REGIMPORT_REXXCODE_HOOK_FILELINE_MANIPULATION'
    {$LINEVAR} = ReplaceString({$LINEVAR}, '09'x, ' ');
#DefineRexx

;--- When I use regasm to create a .reg format file from a .NET assembly,
;--- the file paths are formatted like this, with forward-slashes rather
;--- than back-slashes:
;---     "CodeBase"="file:///C:/Program Files/kutana/Kappris/KSupport3.dll"
#DefineRexx+ 'REGIMPORT_REXXCODE_HOOK_STRING'
    if left({$VALUEVAR}, 8) = 'file:///' then
       {$VALUEVAR} = ReplaceString(substr({$VALUEVAR}, 9), '//', '\')
#DefineRexx

<$RegistryImport "DotNetRegAsmOutput.re4" CURRENT_USER="" LOCAL_MACHINE="" CLASSES_ROOT="">


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: /RegistryComment[Next]: RegistryRead


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.