Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does square brackets [ ] syntax mean in WiX

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:

  1. What does the [] syntax mean in WiX? How is it related to the $() syntax that is used to access the defined value?
  2. Is there any additional meaning for two [] following each other like here [DemoWebsiteWebsite][WEBSITE_ID]?
  3. Why the WebSite Id is used in [DemoWebsiteWebsite] expression? Is that just a coincidence or naming convention?
  4. What are the allowed values to be used inside []? Is there any kind of list for them?
  5. Where can I find additional info about this syntax and cases it is used for?
like image 498
Pavel K Avatar asked May 29 '14 13:05

Pavel K


1 Answers

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.

like image 83
PhilDW Avatar answered Nov 18 '22 07:11

PhilDW