Symbolic expressions

Both Tarma Installer and Windows Installer allow the use of symbolic expressions in many places. There are two styles of symbolic expressions:

You can use the Tarma Installer style everywhere in Tarma ExpertInstall. If you build a Windows Installer package, Tarma ExpertInstall will convert any Tarma-style expressions to the Windows Installer syntax. Tarma ExpertInstall also performs extensive syntax and cross-reference checking on symbolic expressions that use the Tarma-style syntax.

You can use the Windows Installer-style syntax in items that are only used by Windows Installer packages, for example the Windows Installer action sequences and dialog boxes. However, Tarma ExpertInstall will NOT convert Windows Installer-style expressions to Tarma-style syntax if you build a Tarma Installer package, and it will NOT perform syntax or cross-reference checking on Windows Installer-style expressions.

For these reasons, we recommend that you use Tarma-style syntax throughout the project.

Note 1: When you import an MSI database or merge module, Tarma ExpertInstall converts all Windows Installer-style expressions to Tarma-style syntax.

Note 2: In build actions you can only use Tarma Installer style references. Windows Installer style references are not recognized in that context.

MSI note Windows Installer has only limited support for symbolic expressions. For example, you cannot use recursive expressions, no registry or INI file lookup, no runtime functions, no alternate values, and no platform-specific values. If you use any of these, Tarma ExpertInstall will issue a diagnostic message and will try to convert the expression at build time. However, this may not always have the desired effect.

Usage

Symbolic expressions can be used for many purposes:

Furthermore, symbolic expressions and variables are used in conditional expressions.

Syntax

The symbolic expression syntax is defined as follows.

symexpr	::= < expr >
expr	::= varname | #filealias | $compname | %envvar | @regpath |
	    $func(params) | #filepath?section?key | !expr | expr=expr
varname	::= ...name of a product variable (may use symbolic expressions)...
filealias	::= ...alias of installation file (may use symbolic expressions)...
compname	::= ...component name (may use symbolic expressions)...
envvar	::= ...environment variable name (may use symbolic expressions)...
regpath	::= ...path to registry value (may use symbolic expressions)...
func	::= ...name of runtime function...
filepath	::= ...file path (may use symbolic expressions)...
section	::= ...INI file section name (may use symbolic expressions)...
key	::= ...INI file key name (may use symbolic expressions)...

Non-symbolic expressions

To prevent Tarma ExpertInstall from interpreting some text as a symbolic expression, enclose the text in backticks: `...some text...`. You can do this for the entire text, or only for the portions that must not be interpreted. For example:

`<ProgramFilesFolder>`
Resolves to the literal text <ProgramFilesFolder>
`<ProgramFilesFolder>`=<ProgramFilesFolder>
Resolves to <ProgramFilesFolder>=...value of ProgramFilesFolder variable...
`12345<###-%%%%%%%>@@@@@`
Prevents interpretation of the <...> portion in the value (from the PIDTemplate variable).

Expression prefixes

The following prefixes can be used in expr expressions.

Prefix Operands Result
(no prefix) Variable name Value of the product variable, with all symbolic references resolved. See Alphabetical reference for a full list of predefined product variables; you can add your own variables on the Product Variables project page.
# File alias Installation path of the corresponding file.
#...?...?... INI file path, section, key

Value from the corresponding INI file, section, and key, retrieved from the target system at installation time.

MSI note Windows Installer does not support this prefix.

$ Component name Installation path of the folder associated with the component.
$...(...) Function name, parameters

Result from the corresponding runtime function. The required parameters depend on the function. See Runtime functions for a full list.

MSI note Windows Installer does not support this prefix.

% Environment variable Value of the corresponding environment variable, retrieved from the target system at installation time.
@ Registry value path

Value of the corresponding registry value, retrieved from the target system at installation time.

Note: To retrieve the (default) value of a registry key, terminate the registry value path with a backslash ('\').

MSI note Windows Installer does not support this prefix.

! Symbolic expression

The value of the symbolic expression without double lookup.

This allows, for example, expressions like <@<ShellFoldersCU>\My Pictures=!<PersonalFolder>\My Pictures> to behave as expected, instead of treating <...<PersonalFolder>...> as a lookup of the PersonalFolder variable, followed by an attempt to look up the non-existing variable whose name was retrieved from PersonalFolder.

MSI note Windows Installer does not support this prefix.

= Alternate expressions

If the left operand is not empty, the left operand; else the right operand. You may use a sequence of alternate expressions to try them all in succession: expr1=expr2=expr3=...

MSI note Windows Installer does not support this prefix.