The Windows Installer will replace the syntax [PropertyId]
with the Property's value at install time for certain fields. The MSI and WiX SDKs will indicate which fields support "formatted data" (i.e. Property replacements). If a field is not "formatted data" the [PropertyId]
expression will not be evaluated and the value will be left as [PropertyId]
(rarely, the intended result).
For example, the following puts the value of the Property with Id='FOO'
in a registry value:
<Component Directory='InstallFolder'>
<RegistryValue Root='HKLM' Key='SOFTWARE\Manufacturer\Product'
Name='Foo' Value='[FOO]' Type='string' />
</Component>
The formatted syntax also supports a few prefixes to the identifier to get values from items other than Properties. The following is a short list of the most useful:
[!#FileId]
- evaluates to the full path, including file name, where theFile
withId='FileId
' will be installed.[$ComponentId]
- evaluates to the full path of the folder where theComponent
withId='ComponentId'
will be installed.
Note: the paths are only available after CostFinalize
action has completed.
A full list of the available formatting can be found in the MSI SDK's Formatted topic.
Comments
0 comments
Please sign in to leave a comment.