Reputation: 81
I was studying for WiX for several days through some online tutorial. I saw three cases to create some variables
<? define Variable = "value" ?>
and then use the value as $(var.Variable)
<String Id="Variable">Value</String>
and then use the value as !(loc.Variable)
<Property Id="VARIABLE" Value="value" />
and then include the file, use the property in Fragment as [VARIABLE]
I know the localization file is mainly used for different locales. But I don't know when we should use each case. Can anyone help explain?
Upvotes: 5
Views: 8387
Reputation: 42176
I haven't used these constructs that much. However, I think Bob Arnson (WiX developer) explains this pretty well in this blog entry about localization (the explanation is good, but I still manage to confuse myself - carbon error).
Essentially:
$(var.Variable)
- are resolved by the WiX preprosessor - it happens before compilation (Candle.exe
).!(loc.LanguageLcid)
- are resolved at link time (Light.exe
). The linking process can spit out multiple MSI files in different languages. Hence localization is a link-time process.version
and upgrade code
- they remain the same for all output MSI files.Manufacturer
name be localized? Perhaps if you want Asian characters for Asian setups, and an equivalent Latin character name otherwise?setup.exe
launchers with WiX.
I am sure there are other technical reasons as well. Rob or Bob would need to illuminate. There could also be differences in WiX 4
than what I am used to in WiX 3
- and there could be changes planned that I am unaware of.
Some Links:
$(env.someval)
, $(sys.someval)
, $(var.someval)
: https://wixtoolset.org/documentation/manual/v3/overview/preprocessor.htmlUpvotes: 3