方括号[]语法在WiX中意味着什么 [英] What does square brackets [ ] syntax mean in WiX
问题描述
我正在使用WiX工具集为IIS网站创建一个安装程序并使用本手册。我遇到了以下语法
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]
表达式中使用WebSite 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屋!