Qt Installer Framework包目录

Package Directory

包目录

Installers contain components that are either embedded to the installer or loaded from a remote repository. In both cases, you need to use a file format and structure for the components that the installer can read.

安装程序包含嵌入安装程序或从远程存储库加载的组件。在这两种情况下,都需要为安装程序可以读取的组件使用文件格式和结构。

Package Directory Structure

包目录结构

Place all components in the same root directory, which is called the package directory. The directory name acts as a domain-like identifier, which identifies all components. For example, com.vendor.root. The directory name must not contain : or - characters as those are reserved for separating the version number from the identifier.

将所有组件放在同一个根目录中,该目录称为包目录。目录名充当类域标识符,用于标识所有组件。例如,com.vendor.root。目录名不得包含:或-字符,因为这些字符是为分隔版本号和标识符而保留的。

Within the root directory, create subdirectories called data and meta.

在根目录中,创建名为data和meta的子目录。

A package directory can look as follows:

包目录可以如下所示:

-packages
    - com.vendor.root
        - data
        - meta
    - com.vendor.root.component1
        - data
        - meta
    - com.vendor.root.component1.subcomponent1
        - data
        - meta
    - com.vendor.root.component2
        - data
        - meta

Meta Directory

Meta目录

The meta directory contains files that specify settings for deployment and the installation process. The files are not extracted by the installer. The directory must contain at least a package information file and all files that you refer to in the package information file, such as scripts, user interface files, and translations.

meta目录包含指定部署和安装过程设置的文件。安装程序不会提取这些文件。目录必须至少包含一个包信息文件以及在包信息文件中引用的所有文件,如脚本、用户界面文件和翻译。

Package Information File Syntax

包信息文件语法

The package.xml file is the main source of information about a component. The following is an example of a package file:

package.xml文件是组件信息的主要来源。以下是一个包文件的示例:

<?xml version="1.0"?>
<Package>
    <DisplayName>QtGui</DisplayName>
    <Description>Qt gui libraries</Description>
    <Description xml:lang="de_de">Qt GUI Bibliotheken</Description>
    <Version>1.2.3</Version>
    <ReleaseDate>2009-04-23</ReleaseDate>
    <Name>com.vendor.root.component2</Name>
    <Dependencies>com.vendor.root.component1</Dependencies>
    <Virtual>false</Virtual>
    <Licenses>
        <License name="License Agreement" file="license.txt" />
    </Licenses>
    <Script>installscript.qs</Script>
    <UserInterfaces>
        <UserInterface>specialpage.ui</UserInterface>
        <UserInterface>errorpage.ui</UserInterface>
    </UserInterfaces>
    <Translations>
        <Translation>sv_se.qm</Translation>
        <Translation>de_de.qm</Translation>
    </Translations>
    <DownloadableArchives>component2.7z, component2a.7z</DownloadableArchives>
    <AutoDependOn>com.vendor.root.component3</AutoDependOn>
    <SortingPriority>123</SortingPriority>
    <UpdateText>This changed compared to the last release</UpdateText>
    <Default>false</Default>
    <ForcedInstallation>false</ForcedInstallation>
    <ForcedUpdate>false</ForcedUpdate>
    <Essential>false</Essential>
    <Replaces>com.vendor.root.component2old</Replaces>
    <Operations>
        <Operation name="AppendFile">
            <Argument>@TargetDir@/A.txt</Argument>
            <Argument>lorem ipsum</Argument>
        </Operation>
        <Operation name="Extract">
            <Argument>@TargetDir@/Folder1</Argument>
            <Argument>content.7z</Argument>
        </Operation>
        <Operation name="Extract">
            <Argument>@TargetDir@/Folder2</Argument>
        </Operation>
    </Operations>
    <TreeName moveChildren="true">com.vendor.subcomponent</TreeName>
</Package>

Summary of Package Information File Elements

包信息文件元素摘要

ElementDescription
DisplayName

Human-readable name of the component. Required. Specify translations for the name of the component as values of additional DisplayName tags, with the xml:lang attribute set to the correct locale.

组件的可读名称。必要的。将组件名称的翻译指定为其他DisplayName标记的值,并将xml:lang属性设置为正确的区域设置。

Description

Human-readable description of the component. Required. Translations may be specified similarly to DisplayName tag. If a localization that matches the locale is not found and an untranslated version exists, that one will be used. Otherwise no Description will be shown for that locale. User clickable external links, for example a component's homepage, can be included in component description by specifying a URL address like this: {external-link}='https://www.qt.io/'. The URL must be valid and contain a full path to the desired resource.

组件的人类可读描述。必要的。翻译可以类似于DisplayName标签进行指定。如果找不到与区域设置匹配的本地化,并且存在未翻译的版本,则将使用该版本。否则,将不会显示该区域设置的描述。用户可点击的外部链接,例如组件的主页,可以通过指定这样的URL地址包含在组件描述中:{external link}='https://www.qt.io/'. URL必须有效,并包含所需资源的完整路径。

Version

Version number of the component in the following format: [0-9]+((\.|-)[0-9]+)* such as 1-1; 1.2-2; 3.4.7. Required. If a package needs to show the version number from a child rather than it's own (due to grouping of child packages) one can specify the attribute inheritVersionFrom with the package name the version needs to be inherited from.

组件的版本号格式如下:[0-9]+((\.|-)[0-9]+)*,如1-1;1.2-2; 3.4.7. 必要的。如果一个包需要显示子包的版本号,而不是它自己的版本号(由于子包的分组),可以使用需要继承版本的包名指定属性hericVersionFrom。

ReleaseDate

Date when this component version was released. Required.

此组件版本发布的日期。必要的。

Name

Domain-like identification for this component. Required.

此组件的类域标识。必要的

Dependencies

Comma-separated list of identifiers of components that this component depends on. Optionally, you can specify version numbers, separated by a dash (-). You can prefix version numbers with a comparison operator (=, >, <, >= or <=). Keep in mind that you have to use the character reference "&lt;" to escape the left angle bracket (use "&lt;" instead of "<" and "&lt;=" instead of "<="). Optional. For more information, see Component Dependencies.

​此组件所依赖的组件标识符的逗号分隔列表。也可以指定版本号,用破折号(-)分隔。可以在版本号前添加比较运算符(=、>、<、>=或<=)。请记住,必须使用字符引用“&lt;”来转义左尖括号(使用“&lt”代替“<”,使用“&lt;=”代替“<=”)。可选。有关更多信息,请参见组件依赖关系。

AutoDependOn

Comma-separated list of identifiers of components that this component has an automatic dependency on. The component is installed if and only if all of the specified dependencies are fulfilled. If a component has an automatic dependency on other components, the check box will not be visible next to the component in the component tree, but this does not change the visibility of the check box in the updater view where the end user may still manually select the component for update.

此组件具有自动依赖关系的组件标识符的逗号分隔列表。仅当满足所有指定的依赖关系时,才会安装该组件。如果一个组件自动依赖于其他组件,则组件树中该组件旁边的复选框将不可见,但这不会改变更新器视图中复选框的可见性,最终用户仍可以手动选择要更新的组件。

When running an installer or a maintenance tool in package manager mode, the selection will be performed automatically. If the component was not installed before, it will be selected for installation only when all components from this list are also selected for installation. If the component was already installed, it will be selected for uninstallation or for update when at least one of the components from this list is also selected for uninstallation or for update. For more information, see Component Dependencies.

​在包管理器模式下运行安装程序或维护工具时,将自动执行选择。如果该组件以前未安装,则只有当此列表中的所有组件都已选择安装时,才会选择安装该组件。如果该组件已安装,当此列表中的至少一个组件也被选择卸载或更新时,它将被选择进行卸载或更新。有关更多信息,请参见组件依赖关系。

Virtual

Set to true to hide the component from the installer. This also hides any child components this component may have, including their descendants. Note that setting this on a root component does not work.

设置为true可在安装程序中隐藏组件。这也隐藏了此组件可能具有的任何子组件,包括它们的后代。请注意,在根组件上设置此项不起作用。

SortingPriority

Priority of the component in the tree. The tree is sorted from highest to lowest priority, with the highest priority on the top.

树中组件的优先级。树从最高优先级到最低优先级排序,最高优先级在顶部。

Licenses

List of license agreements to be accepted by the installing user. To add several licenses, add several <License> child elements that each specify the license name and file and, optionally, priority. ASCII and UTF8 file formats are supported for license files.

安装用户接受的许可协议列表。要添加多个许可证,请添加多个<License>子元素,每个子元素指定许可证namefile ,以及priority(可选)。许可证文件支持ASCII和UTF8文件格式。

If there are translations listed for this component, the installer will also look for translated licenses. These need to have the same name as the original license file but with an added locale identifier. If for example the license file is called license.txt and there is German translation specified, the installer will also include a license_de_de.txt file (and show that when installing on a German system).

如果列出了此组件的翻译,安装程序还将查找翻译后的许可证。这些需要与原始许可证文件同名,但添加了区域设置标识符。例如,如果许可证文件名为license.txt,并且指定了德语翻译,则安装程序还将包含license_de_de.txt文件(并在德语系统上安装时显示)。

Script

File name of a script being loaded. Optional. Specifying the postLoad="true" attribute will cause the script to be loaded only to the component that is selected for update or install. With the attribute, the script is loaded right before the component installation starts. This will speed up the installer if there are large amounts of components with install scripts in the repository. Make sure the script does not contain anything that needs to be evaluated before the install tree view is shown. For more information, see Adding Operations and Using postLoad in component script.

​正在加载的脚本的文件名。可选。指定postLoad=“true”属性将导致脚本仅加载到选择进行更新或安装的组件。使用该属性,脚本将在组件安装开始之前加载。如果存储库中有大量带有安装脚本的组件,这将加快安装程序的速度。确保脚本中不包含在显示安装树视图之前需要评估的任何内容。有关更多信息,请参阅在组件脚本中添加操作和使用postLoad。

UserInterfaces

List of pages to load. To add several pages, add several <UserInterface> child elements that each specify the filename of a page. Optional. For more information, see Adding Pages.

​要加载的页面列表。要添加多个页面,请添加几个<UserInterface>子元素,每个子元素指定页面的文件名。可选。有关详细信息,请参阅添加页面。

Translations

List of translation files to load. To add several language variants, specify several <Translation> child elements that each specify the filename of a language variant. The installer loads the translation file that matches the current system locale. For example, if the system locale is German, the de.qm file is loaded. Optional. For more information, see Translating Pages.

​要加载的翻译文件列表。要添加多个语言版本,请指定几个<Translation>子元素,每个子元素指定一个语言版本的文件名。安装程序加载与当前系统区域设置匹配的翻译文件。例如,如果系统区域设置为德语,则加载de.qm文件。可选。有关更多信息,请参阅翻译页面。

UpdateText

Description added to the component description if this is an update to the component. Optional.

如果这是对组件的更新,则将描述添加到组件描述中。可选。

Default

Possible values are: truefalse, and script. Set to true to preselect the component in the installer. This takes effect only on components that have no visible child components. The boolean values are evaluated directly, while script is resolved during runtime. Add the name of the script as a value of the <Script> element in this file. For an example script, see Selecting Default Contents.

​可能的值有:true、false和script。设置为true可在安装程序中预选组件。这仅对没有可见子组件的组件生效。布尔值直接计算,而脚本在运行时解析。将脚本的名称作为此文件中<script>元素的值添加。有关示例脚本,请参见选择默认内容。

Essential

Marks the package as essential to force a restart of the MaintenanceTool. If there are updates available for an essential component, the package manager stays disabled until that component is updated. Newly introduced essential components are automatically installed when running the updater.

将包装标记为强制重新启动MaintenanceTool所必需的。如果某个基本组件有可用的更新,则包管理器将保持禁用状态,直到该组件更新为止。运行更新程序时,会自动安装新引入的基本组件。

ForcedInstallation

Determines that the package must always be installed. End users cannot deselect it in the installer. When updating components, the component can still be deselected from an update.

确定必须始终安装该包。最终用户无法在安装程序中取消选择它。更新组件时,仍然可以从更新中取消选择该组件。

ForcedUpdate

Marks the package as ForcedUpdate to force a restart of the MaintenanceTool. If there are updates available for a ForcedUpdate component, the package manager stays disabled until that component is updated.

将包标记为ForcedUpdate,以强制重新启动MaintenanceTool。如果ForcedUpdate组件有可用的更新,则包管理器将保持禁用状态,直到该组件更新为止。

Replaces

Comma-separated list of components to replace. Optional.

用逗号分隔的要替换的组件列表。可选。

DownloadableArchives

Lists the data files (separated by commas) for an online installer to download. If there is some data inside the component and the package.xml and/or the script has no DownloadableArchives value, the repogen tool registers the found data automatically.

列出在线安装程序要下载的数据文件(用逗号分隔)。如果组件中有一些数据,并且package.xml或脚本没有DownloadableArchives值,则重新生成工具会自动注册找到的数据。

RequiresAdminRights

Set to true if the package needs to be installed with elevated permissions. Optional.

如果需要使用提升的权限安装包,请设置为true。可选。

Checkable

Set to false if you want to hide the checkbox for an item. This is useful when only a few subcomponents should be selected instead of all. When updating components, the checkbox is still visible to allow toggling the component for update. Optional.

如果要隐藏项目的复选框,请设置为false。当只应选择少数子组件而不是所有子组件时,这很有用。更新组件时,复选框仍然可见,以允许切换组件进行更新。可选。

ExpandedByDefault

Set to true if you want this item to be expanded by default. Optional.

如果希望默认展开此项目,请设置为true。可选。

Operations

List of operations that are performed when component is installed. To add several operations, specify several <Operation> child elements that each specify the operation nameOperation can have several <Argument> child elements depending on the operation to be run. Adding <Operations> is an alternative way of defining operations to defining them in scripts. For more information, see Adding Operations. For a summary of available operations, see Operations.

​安装组件时执行的操作列表。要添加多个操作,请指定多个<Operation>子元素,每个子元素都指定操作name。根据要Operation 的操作,操作可以有几个<Argument>子元素。添加<Operations>是一种在脚本中定义操作的替代方法。有关详细信息,请参阅添加操作。有关可用操作的摘要,请参阅操作。

TreeName

Specifies the component location in the install tree view. Overwrites the original location which is calculated from component name. Component names and tree names must be unique. Optional.

指定安装树视图中的组件位置。覆盖根据组件名称计算的原始位置。组件名称和树名称必须唯一。可选。

Specifying moveChildren="true" attribute will also change the location of any child components this component has. Children will move to the overwritten tree name, keeping the relative location to their parent component.

指定moveChildren=“true”属性也将更改此组件所具有的任何子组件的位置。子节点将移动到覆盖的树名称,保持与父组件的相对位置。

One component branch in the install tree view can have multiple components specifying a tree name. The order in which the location of components is changed is from leaf to root components.

安装树视图中的一个组件分支可以有多个指定树名称的组件。组件位置更改的顺序是从叶组件到根组件。

Component Dependencies

组件依赖

Components can depend on one or several real or virtual components. Dependencies are defined by using the component identifier and, optionally, component version. Use a dash (-) to separate version numbers from identifiers.

组件可以依赖于一个或多个真实或虚拟组件。依赖关系是通过使用组件标识符和组件版本(可选)来定义的。使用破折号(-)将版本号与标识符分开。

You can prefix version numbers with a comparison operator (=, >, &lt; (<), >= or &lt;= (<=)) to indicate that the version number of the package is compared to the required version and has to be equal to, greater than, less than, greater than or equal to, or less than or equal to the version number specified in the dependency. If no comparison operator is given, it defaults to =.

可以在版本号前添加比较运算符(=、>、&lt; (<)、>=或&lt;= (<=))表示将包的版本号与所需版本进行比较,并且必须等于、大于、小于、大于或等于或小于或等于依赖关系中指定的版本号。如果没有给出比较运算符,则默认为=。

Data Directory

数据目录

The data directory contains the content that the installer extracts during the installation. The data must be packaged into archive files. This is either done automatically by binarycreator and repogen when creating an installer or a repository, respectively, or you can do this beforehand for more control.

data 目录包含安装程序在安装过程中提取的内容。数据必须打包到归档文件中。这要么是由binarycreator和repogen分别在创建安装程序或存储库时自动完成的,要么可以提前这样做以获得更多控制。

For manual archive creation you can use either the archivegen tool that is delivered with the Qt Installer Framework or some other tool that generates archives in any of the file formats: 7zziptar.gztar.bz2 and tar.xz.

​对于手动创建存档,您可以使用Qt Installer Framework附带的archivegen工具,也可以使用其他工具生成任何文件格式的存档:7z、zip、tar.gz、tar.bz2和tar.xz。

Note: If the Installer Framework tools were built without libarchive support, only 7z format is supported.

注意:如果安装程序框架工具是在没有libarchive支持的情况下构建的,则只支持7z格式。

Configuration FileAlias Definition File

© 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.

### 回答1: Qt Installer Framework 是一个用于创建跨平台安装程序的工具。它是由 Qt 公司开发的,可用于构建 Windows、macOS 和 Linux 上的安装程序。Qt Installer Framework 允许开发者创建自定义的安装界面,支持括自动更新和卸载在内的高级功能,使得应用程序的安装和升级变得更加方便。此外,Qt Installer Framework 还提供了强大的脚本语言和插件系统,以便开发者可以轻松地添加自己的定制功能。 ### 回答2: Qt Installer Framework是一个开源的安装框架,用于创建跨平台的安装程序。它是由Qt官方社区开发的,用于帮助开发人员轻松地制作各种类型的安装程序。 Qt Installer Framework具有很多强大的特性。首先,它支持主流操作系统,括Windows、macOS和Linux。这使得开发人员可以使用相同的框架来创建针对不同平台的安装程序,极大地简化了开发和维护的工作。 其次,Qt Installer Framework提供了一个灵活的界面,开发人员可以轻松地定制安装程序的界面。他们可以选择添加自定义的图标、背景图像和品牌标志等来打造与自己应用程序一致的安装体验。 此外,Qt Installer Framework还支持自定义安装组件,开发人员可以将安装的内容分组到不同的组件中,根据用户需求进行选择性安装。这对于大型应用程序来说非常有用,因为用户可以根据自己的需求选择安装哪些组件,从而减少不必要的空间占用。 另一个重要的特性是Qt Installer Framework支持安装程序的自动升级。开发人员可以配置安装程序,使其能够检测并下载更新,并在用户同意的情况下自动升级程序。这可以确保用户始终使用最新版本的应用程序,提供更好的用户体验以及安全性。 综上所述,Qt Installer Framework是一个功能强大且易于使用的安装框架,可以帮助开发人员轻松创建跨平台的安装程序。它的灵活性和可定制性使得开发人员可以根据自己的需求创建出符合用户期望的安装体验。 ### 回答3: Qt Installer Framework(简称QtIFW)是一个创建安装程序的开源工具集,用于在Windows、Mac和Linux等操作系统上安装Qt应用程序。 Qt Installer Framework提供了一个易于使用的图形界面,允许开发者自定义安装向导和界面。它支持各种高级功能,如自动更新和升级、安装前检查依赖项、注册表设置、缓存管理等。 Qt Installer Framework的核心概念是组件。开发者可以将应用程序划分为多个组件,并在安装时选择安装哪些组件。这样,用户可以自定义安装过程,只选择需要的功能和资源,减少安装空间和时间。 Qt Installer Framework还支持多语言安装,用户可以选择在安装过程中使用哪种语言,提供了灵活的国际化功能。 此外,Qt Installer Framework还支持数字签名验证和认证,确保安装程序的完整性和可信性。 对于开发者来说,Qt Installer Framework提供了灵活的定制选项,可以自定义安装界面和过程,满足特定需求。开发者可以通过简单的脚本语言,定义安装程序的行为。 总的来说,Qt Installer Framework是一个功能强大、易于使用的工具集,为开发者提供了创建跨平台安装程序的便利,提升了用户体验和应用程序的可用性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值