FormatRecord Method
[This is preliminary documentation and subject to change.]
This is the FormatRecord method of the MsiEngine object. This method returns a formatted string from a template and record data.
Syntax
object.FormatRecord(record)
Parts
-
object
-
MsiEngine object.
-
record
-
Required MsiRecord object containing a template and data to be formatted. The template string must be set in field 0 followed by any referenced data parameters.
Remarks
The FormatRecord method uses the following format process.
Parameters to be formatted are enclosed in square brackets [..]. The square brackets can be iterated because the substitutions are resolved from inside out.
If a part of the string is enclosed in curly braces { } and contains no square brackets, the part is left unchanged, including the curly braces.
If a part of the string is enclosed in curly braces and contains one or more property names, and if all the properties are found, the text (with the resolved substitutions) is displayed without the curly braces. If any of the properties are not found, all the text in the curly braces and the braces themselves are removed.
To format strings using the FormatRecord method
-
The numeric parameters are substituted by replacing the marker with the value of the corresponding record field, with missing or Null values producing no text.
-
The string that results is processed by replacing the non-record parameters with the corresponding values, as noted in the following descriptions.
-
If a substring of the form "[propertyname]" is encountered, it is replaced by the value of the property.
-
If a substring of the form "[%environmentvariable]" is found, the value of the environment variable is substituted.
-
If a substring of the form "[#filekey]" is found, it is replaced by the full path of the file, with the value filekey used as a key into the File table.
-
If a substring of the form "[$componentkey]" is found, it is replaced by the installation directory of the component, with the value componentkey used as a key into the Component table, taking into account the Component.Action column state. If the component is selected to be installed locally, it is replaced by the target directory. If the component is selected to run from source, it is replaced by the source directory. If the component is not selected, or if the component is missing, it is replaced by a Null string.
-
If a substring of the form "[\c]" is found, it is replaced by the character without any further processing. Only the first character after the backslash is kept; everything else is removed.