I'm creating an installer for an IIS website using the WiX toolset and I use this manual. I've came across the following syntax:
<iis:WebSite Id="DemoWebsiteWebsite" Description='Demo Website' Directory='INSTALLFOLDER' AutoStart='yes' StartOnInstall='yes'>
<iis:WebAddress Id="AllUnassigned" Port="80" />
<iis:WebApplication Id="DemoWebsiteApplication" Name="[DemoWebsiteWebsite][WEBSITE_ID]" WebAppPool="DemoWebsiteAppPool"></iis:WebApplication>
</iis:WebSite>
I'm confused by the []
syntax and the way website id is used here. I need to use some custom values entered by user for that. So I have the following questions:
[]
syntax mean in WiX? How is it related to the $()
syntax that is used to access the defined value?[]
following each other like here [DemoWebsiteWebsite][WEBSITE_ID]
?[DemoWebsiteWebsite]
expression? Is that just a coincidence or naming convention?[]
? Is there any kind of list for them?This is the way that Windows Installer properties are resolved to the actual values. If you entered a property called WEBSITE into an MSI dialog you'd get that resolved to the actual value by putting it in square brackets. That's why you see things like [TARGETDIR], [SourceDir] and so on. The syntax is used in most tools that generate MSI files because it's a Windows Installer thing.
This is the doc link, it's all hidden here:
Formatted Windows Installer
So 1 - they are properties in the MSI file, either standard Windows Installer properties or user-created ones:
Property Reference
and 2, they are just two properties concatenated. They are case-sensitive so don't be sloppy with the case. The other points should be clear after understanding that they are installer properties.
The $() values in WiX source are compile time - they resolve at build time to actual values. The [] values resolve at install time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With