Alias Definition File
别名定义文件
The alias definition file defines the available component aliases and their properties. The file is typically called aliases.xml
and located in the config
directory.
别名定义文件定义了可用的组件别名及其属性。该文件通常名为aliases.xml,位于config目录中。
The component names of the Qt Installer Framework follow a domain-like identifier syntax, for example com.vendor.root
, com.vendor.root.subcomponent
, and so on. While this allows an easy way to construct a tree from the components when running the installer in graphical mode, the names can be unintuitive for command line usage, where the components are not displayed in a tree view.
Qt安装程序框架的组件名称遵循类域标识符语法,例如com.vendor.root、com.vendor.reot.subcomponent等。虽然这允许在图形模式下运行安装程序时从组件构建树的简单方法,但这些名称对于命令行使用来说可能不直观,因为组件不会显示在树视图中。
Instead of relying on the domain-like names for CLI usage, the packager can also define component aliases for existing components. An alias is another name for a single component or a collection of components. It can be used to declare alternative names for existing components that are easier to type and combine multiple components under the same alias name, for easier selection.
打包者还可以为现有组件定义组件别名,而不是依赖类域名来使用CLI。别名是单个组件或组件集合的另一个名称。它可用于声明现有组件的替代名称,这些名称更容易在同一别名下键入和组合多个组件,以便于选择。
The following example shows a possible alias definition file:
以下示例显示了一个可能的别名定义文件:
<?xml version="1.0"?>
<Aliases>
<Alias>
<Name>package-full</Name>
<DisplayName>Full installation package</DisplayName>
<Description>Complete installation of the product</Description>
<Version>1.0.0</Version>
<Virtual>false</Virtual>
<RequiredAliases>package-essential</RequiredAliases>
<RequiredComponents>com.vendor.root.extras</RequiredComponents>
<OptionalAliases>package-optional</OptionalAliases>
</Alias>
<Alias>
<Name>package-essential</Name>
<DisplayName>Essential components</DisplayName>
<Description>Essential components for the product</Description>
<Version>1.0.0</Version>
<Virtual>false</Virtual>
<RequiredComponents>com.vendor.root.essential</RequiredComponents>
</Alias>
<Alias>
<Name>package-optional</Name>
<DisplayName>Optional components</DisplayName>
<Description>Optional components for the product</Description>
<Version>1.0.0</Version>
<Virtual>false</Virtual>
<OptionalComponents>com.vendor.root.optional1,com.vendor.root.optional2</OptionalComponents>
</Alias>
</Aliases>
Summary of Alias Definition File Elements
别名定义文件元素摘要
The following table summarizes the elements in the alias definition file.
下表总结了别名定义文件中的元素。
Element | Description |
---|---|
Name | Name of component alias. 组件别名的名称。 |
DisplayName | Human-readable name of the component alias. 组件别名的人类可读名称。 |
Description | Human-readable description of the component alias. 组件别名的人类可读描述。 |
Version | Version number of the component alias. 组件别名的版本号。 |
Virtual | Set to 设置为true可在安装程序中隐藏组件别名。这也使得用户无法选择别名。 |
RequiredComponents | Comma-separated list of identifiers of components that this component alias requires. The components are selected for installation when the component alias is selected. Note that the components must be selectable by the user, so virtual or otherwise unselectable components cannot be listed as a requirement. 此组件别名所需的组件标识符的逗号分隔列表。选择组件别名后,将选择要安装的组件。请注意,组件必须可由用户选择,因此虚拟或其他不可选择的组件不能作为要求列出。 |
RequiredAliases | Comma-separated list of aliases that this component alias requires. The required aliases are selected for installation when this component alias is selected. 此组件别名所需的以逗号分隔的别名列表。选择此组件别名时,将选择所需的别名进行安装。 |
OptionalComponents | Comma-separated list of identifiers of components that this component alias optionally depends on. The components are selected for installation when the component alias is selected, if the components exists and are user selectable. Even if the components cannot be found in the installer, this alias is not marked unstable. 此组件别名可选依赖的组件标识符的逗号分隔列表。如果组件存在并且用户可选择,则在选择组件别名时选择组件进行安装。即使在安装程序中找不到组件,此别名也不会标记为不稳定。 |
OptionalAliases | Comma-separated list of aliases that this component alias optionally depends on. The listed aliases are selected for installation when this component alias is selected, if the aliases exist. Even if the aliases don't exists in the installer, this alias is not marked unstable. 此组件别名可选依赖的别名列表,以逗号分隔。如果存在别名,则在选择此组件别名时,会选择列出的别名进行安装。即使安装程序中不存在别名,此别名也不会标记为不稳定。 |
Configuration FileController Scripting
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The Qt Company, Qt and their respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.