Link-time variables
Like Candle, Light allows you to specify variables that will be interpreted when your project is built. Here, however, the variables are processed at link time. There are three types of link-time variables: localization, binder, and custom. We will take a look at each in the following sections.
Localization variables
WiX gives you something unique in the MSI-building world—a way to re-use one set of .wxs
files for many different languages. The way to do it is to use a variable anywhere that you'd normally place text, such as on dialog controls, feature labels, directory names, and so on. At link time, these localization variables will be swapped with the text specific to the language you're building.
Use the !(loc.
VariableName
)
syntax in your WiX markup, as follows:
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLLOCATION" Name="!(loc.InstallDirName)" /> </Directory> </Directory...