WiX中的方括号[]语法是什么意思 [英] What does square brackets [ ] syntax mean in WiX
问题描述
我正在使用 WiX 工具集和 本手册.我遇到了以下语法
I'm creating an installer for IIS website using WiX toolset and using this manual. I've came across 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>
我对 []
语法和此处使用网站 ID 的方式感到困惑.我需要为此使用用户输入的一些自定义值.所以我有以下问题:
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 following questions:
[]
语法在 WiX 中是什么意思?它与用于访问定义值的$()
语法有何关系?- 像这里
[DemoWebsiteWebsite][WEBSITE_ID]
这样的两个[]
相互跟随有什么额外的含义吗? - 为什么在
[DemoWebsiteWebsite]
表达式中使用网站 ID?这只是巧合还是命名约定? []
中允许使用哪些值?有他们的清单吗?- 我在哪里可以找到有关此语法及其使用情况的更多信息?
- What does the
[]
syntax mean in WiX? How it is related with the$()
syntax that used to access the defined value? - Is there any additional meaning for two
[]
following each other like here[DemoWebsiteWebsite][WEBSITE_ID]
? - Why the WebSite Id is used in
[DemoWebsiteWebsite]
expression? Is that just a coincidence or naming convention? - What are the allowed values to be used inside
[]
? Is there any kind of list for them? - Where can I find additional info about this syntax and cases it is used for?
推荐答案
这是将 Windows Installer 属性解析为实际值的方式.如果您在 MSI 对话框中输入了一个名为 WEBSITE 的属性,您可以通过将其放在方括号中来将其解析为实际值.这就是为什么您会看到 [TARGETDIR]、[SourceDir] 等内容.大多数生成 MSI 文件的工具都使用该语法,因为它是 Windows Installer 的东西.
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:
所以 1 - 它们是 MSI 文件中的属性,标准的 Windows Installer 属性或用户创建的属性:
So 1 - they are properties in the MSI file, either standard Windows Installer properties or user-created ones:
和 2,它们只是连接在一起的两个属性.它们区分大小写,所以不要对大小写马虎.其他点在了解它们是安装程序属性后应该清楚.
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.
WiX 源代码中的 $() 值是编译时的 - 它们在构建时解析为实际值.[] 值在安装时解析.
The $() values in WiX source are compile time - they resolve at build time to actual values. The [] values resolve at install time.
这篇关于WiX中的方括号[]语法是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!