Qt Installer Framework配置文件

Configuration File

配置文件

The configuration file customizes the UI and behavior of an installer. The file is typically called config.xml and located in the config directory.

配置文件自定义安装程序的UI和行为。该文件通常名为config.xml,位于config目录中。

A minimal configuration file consists of an <Installer> root element with <Name> and <Version> elements as children. All other elements are optional, and can appear in arbitrary order.

最小配置文件由一个<Installer>根元素组成,其中<Name>和<Version>元素作为子元素。所有其他元素都是可选的,可以以任意顺序出现。

The following example shows a typical configuration file:

以下示例显示了一个典型的配置文件:

<?xml version="1.0"?>
<Installer>
    <Name>Some Application</Name>
    <Version>1.0.0</Version>
    <Title>Some Application Setup</Title>
    <Publisher>Your Company</Publisher>
    <ProductUrl>http://www.your-fantastic-company.com</ProductUrl>
    <InstallerWindowIcon>installericon</InstallerWindowIcon>
    <InstallerApplicationIcon>installericon</InstallerApplicationIcon>
    <Logo>logo.png</Logo>
    <Watermark>watermark.png</Watermark>
    <RunProgram>@TargetDir@/YourAppToRun</RunProgram>
    <RunProgramArguments>
        <Argument>Argument 1</Argument>
        <Argument>Argument 2</Argument>
    </RunProgramArguments>
    <RunProgramDescription>My nice application</RunProgramDescription>
    <StartMenuDir>Some Application Entry Dir</StartMenuDir>
    <MaintenanceToolName>SDKMaintenanceTool</MaintenanceToolName>
    <AllowNonAsciiCharacters>true</AllowNonAsciiCharacters>
    <Background>background.png</Background>

    <TargetDir>@HomeDir@/testinstall</TargetDir>
    <AdminTargetDir>@RootDir@/testinstall</AdminTargetDir>
    <RemoteRepositories>
        <Repository>
            <Url>http://www.your-repo-location/packages/</Url>
        </Repository>
    </RemoteRepositories>
    <AliasDefinitionsFile>aliases.xml</AliasDefinitionsFile>
</Installer>

Summary of Configuration File Elements

配置文件元素摘要

The following table summarizes the elements in the configuration file.

下表总结了配置文件中的元素。

Note: We recommend that you place all files that you refer to in the configuration file in the config directory. However, you can also use relative paths, which the tools resolve relative to the location of the config.xml file.

注意:我们建议将配置文件中引用的所有文件放置在config目录中。但是,也可以使用相对路径,工具会根据config.xml文件的位置解析相对路径。

Note: The filenames of the referred files must be unique. That is, if you want to use the same image for both <Logo> and <Watermark>, you must add two copies of the image file with different filenames.

注意:所引用文件的文件名必须是唯一的。也就是说,如果您想为<Logo>和<Watermark>使用相同的图像,则必须添加两个具有不同文件名的图像文件副本。

You can use predefined variables (embedded in @ characters) as values of the elements. For more information, see Predefined Variables.

​可以使用预定义的变量(嵌入在@字符中)作为元素的值。有关详细信息,请参见预定义变量。

ElementDescription
Name

Name of the product being installed. This is mandatory.

正在安装的产品的名称。这是强制性的。

Version

Version of the product being installed in the following format: [0-9]+((\.|-)[0-9]+)* such as 1-1; 1.2-2; 3.4.7. This is mandatory.

正在安装的产品版本,格式如下:[0-9]+((\.|-)[0-9]+)*,例如1-1;1.2-2; 3.4.7. 这是强制性的。

Title

Name of the installer as displayed on the title bar.

标题栏上显示的安装程序名称。

Publisher

Publisher of the software (as shown in the Windows Control Panel).

软件的发布者(如Windows控制面板中所示)。

ProductUrl

URL to a page that contains product information on your web site.

指向网站上包含产品信息的页面的URL。

InstallerApplicationIcon

Filename for a custom installer icon. The actual file is looked up by attaching a '.icns' (macOS), '.ico' (Windows) suffix. No functionality on Unix.

自定义安装程序图标的文件名。通过附加'.icns'(macOS)、'.ico'(Windows)后缀来查找实际文件。Unix上没有功能。

InstallerWindowIcon

Filename for a custom window icon in PNG format for the Installer application. Used on Windows and Linux, no functionality on macOS.

安装程序应用程序的PNG格式自定义窗口图标的文件名。在Windows和Linux上使用,在macOS上没有功能。

Logo

Filename for a logo in PNG format used as QWizard::LogoPixmap.

PNG格式徽标的文件名,用作QWizard::LogoPixmap。

Watermark

Filename for a watermark in PNG format used as QWizard::WatermarkPixmap. If <WizardShowPageList> is set to true, the watermark is hidden.

用作QWizard::WatermarkPixmap的PNG格式水印的文件名。如果将<WizardShowPageList>设置为true,则水印将被隐藏。

Banner

Filename for a banner in PNG format used as QWizard::BannerPixmap (only used by ModernStyle).

用作QWizard::BannerPixmap的PNG格式横幅的文件名(仅由ModernStyle使用)。

Background

Filename for an image in PNG format used as QWizard::BackgroundPixmap (only used by MacStyle). If <WizardShowPageList> is set to true, the background is hidden.

用作QWizard::BackgroundPixmap的PNG格式图像的文件名(仅限MacStyle使用)。如果将<WizardShowPageList>设置为true,则隐藏背景。

PageListPixmap

Filename for an image in PNG format shown on top of installer page list. The image is shown only if <WizardShowPageList> is also set to true.

安装程序页面列表顶部显示的PNG格式图像的文件名。只有当<WizardShowPageList>也设置为true时,才会显示图像。

WizardStyle

Set the wizard style to be used ("Modern", "Mac", "Aero" or "Classic").

设置要使用的向导样式(“现代”、“Mac”、“Aero”或“经典”)。

StyleSheet

Set the stylesheet file.

设置样式表文件。

WizardDefaultWidth

Sets the default width of the wizard in pixels. Setting a banner image will override this. You can add the em or ex suffix to the specified value to use the em or ex unit, as in a CSS file.

设置向导的默认宽度(像素)。设置横幅图像将覆盖此设置。可以在指定值后添加em或ex后缀,以使用em或ex单位,就像在CSS文件中一样。

WizardDefaultHeight

Sets the default height of the wizard in pixels. Setting a watermark image will override this. You can add the em or ex suffix to the specified value to use the em or ex unit, as in a CSS file.

设置向导的默认高度(像素)。设置水印图像将覆盖此设置。可以在指定值后添加em或ex后缀,以使用em或ex单位,就像在CSS文件中一样。

WizardMinimumWidth

Sets the minimum width of the wizard in pixels. You can add the em or ex suffix to the specified value to use the em or ex unit, as in a CSS file.

设置向导的最小宽度(像素)。可以在指定值后添加em或ex后缀,以使用em或ex单位,就像在CSS文件中一样。

WizardMinimumHeight

Sets the minimum height of the wizard in pixels. You can add the em or ex suffix to the specified value to use the em or ex unit, as in a CSS file.

设置向导的最小高度(像素)。可以在指定值后添加em或ex后缀,以使用em或ex单位,就像在CSS文件中一样。

WizardShowPageList

Set to false if the widget listing installer pages on the left side of the wizard should not be shown. Defaults to true. If visible, this widget hides QWizard::WatermarkPixmap on QWizard::ClassicStyle and QWizard::ModernStyle, and QWizard::BackgroundPixmap on QWizard::MacStyle.

如果不应显示向导左侧列出安装程序页面的widget,则设置为false。默认为true。如果可见,此widget会隐藏QWizard::ClassicStyleQWizard::ModernStyle上的QWizard::WatermarkPixmap,以及QWizard::MacStyle上的QWizard::BackgroundPixmap

ProductImages

A list of images to be shown on PerformInstallationPage. This element can have one or several <ProductImage> child elements that contain an <Image> child element and an optional <Url> child element. The <Image> element specifies a filename for an image in PNG format. Optional <Url> can be specified for each image. Clicking on the image will open the <Url> in a browser. If the <Url> is a reference to a file, it will be opened with a suitable application instead of a Web browser.

要在PerformInstallationPage上显示的图像列表。此元素可以有一个或多个包含<Image>子元素和可选<Url>子元素的<ProductImage>子元素。<Image>元素指定PNG格式图像的文件名。可以为每个图像指定可选的<Url>。点击图片将在浏览器中打开<Url>。如果<Url>是对文件的引用,则将使用合适的应用程序而不是Web浏览器打开它。

TitleColor

Set the color of the titles and subtitles (takes an HTML color code, such as "#88FF33").

设置标题和字幕的颜色(采用HTML颜色代码,如“#88FF33”)。

RunProgram

Command executed after the installer is done if the user accepts the action. Provide the full path to the application.

如果用户接受该操作,则在安装程序完成后执行的命令。提供应用程序的完整路径。

RunProgramArguments

Arguments passed to the program specified in <RunProgram>. You can add several <Argument> child elements that each specify an argument to <RunProgram>.

传递给<RunProgram>中指定的程序的参数。可以添加几个<Argument>子元素,每个子元素都为<RunProgram>指定一个参数。

RunProgramDescription

Text shown next to the check box for running the program after the installation. If <RunProgram> is set but no description provided, the UI will display Run <Name> now. instead.

安装后运行程序的复选框旁边显示的文本。相反如果设置了<RunProgram>但没有提供描述,则UI现在将显示Run<Name>。

StartMenuDir

Name of the default program group for the product in the Windows Start menu.

Windows“开始”菜单中产品的默认程序组的名称。

TargetDir

Default target directory for installation. On Linux, this is usually the user's home directory.

安装的默认目标目录。在Linux上,这通常是用户的主目录。

AdminTargetDir

Default target directory for installation with administrator rights. Only available on Linux, where you usually do not want to install in the administrator user's home directory.

具有管理员权限的默认安装目标目录。仅在Linux上可用,通常不希望在管理员用户的主目录中安装。

LocalCacheDir

Directory name for storing the metadata cache. This does not include the leading directories, which are determined automatically based on a suitable platform specific location for storing cache files. The user may override the path from the installer settings. The default value is a UUID generated from the name of the product being installed.

用于存储元数据缓存的目录名称。这不包括主要目录,这些目录是根据存储缓存文件的合适平台特定位置自动确定的。用户可以覆盖安装程序设置中的路径。默认值是根据所安装产品的名称生成的UUID。

PersistentLocalCache

Set to false if the fetched metadata should be removed from the local cache when the installer exits. Otherwise the contents of the cache are kept to speed up subsequent fetches. Defaults to true.

如果安装程序退出时应从本地缓存中删除获取的元数据,则设置为false。否则,缓存的内容将被保留,以加快后续的获取速度。默认为true。

RemoteRepositories

List of remote repositories. This element can contain several <Repository> child elements that each contain the <Url> child element that specifies the URL to access the repository. For more information, see Configuring Repositories.

​远程存储库列表。此元素可以包含多个<Repository>子元素,每个子元素都包含指定访问存储库的Url的<Url>子元素。有关更多信息,请参阅配置存储库。

RepositoryCategories

Name of a category that can contain a list of <RemoteRepositories> child elements. For more information, see Configuring Repository Categories.

​可以包含<RemoteRepositories>子元素列表的类别的名称。有关更多信息,请参阅配置存储库类别。

MaintenanceToolName

Filename of the generated maintenance tool. Defaults to maintenancetool. The platform-specific executable file extension is appended.

生成的维护工具的文件名。默认为maintenancetool。附加了特定于平台的可执行文件扩展名。

MaintenanceToolIniFile

Filename for the configuration of the generated maintenance tool. Defaults to MaintenanceToolName.ini.

生成的维护工具的配置文件名。默认为MaintenanceToolName.ini。

MaintenanceToolAlias

Filename for an alias of the maintenance tool that will be created to the Applications directory. Optional. Only used on macOS.

将创建到Applications目录的维护工具别名的文件名。可选,仅在macOS上使用。

RemoveTargetDir

Set to false if the target directory should not be deleted when uninstalling.

如果卸载时不应删除目标目录,则设置为false。

AllowNonAsciiCharacters

Set to true if the installation path can contain non-ASCII characters.

如果安装路径可以包含非ASCII字符,则设置为true。

DisableAuthorizationFallback

Set to true if the installation should not ask users to run the authorization fallback in case of authorization errors. Instead abort the installation immediately.

如果在发生授权错误时安装不应要求用户运行授权回退,则设置为true。请立即中止安装。

DisableCommandLineInterface

Set to true if command line interface features should be disabled. This prevents the user from passing any consumer command to installer, like installupdate and remove. Other options can still be used normally. Defaults to false.

如果应禁用命令行界面功能,则设置为true。这可以防止用户将任何消费者命令传递给安装程序,如安装、更新和删除。其他选项仍可正常使用。默认为false。

RepositorySettingsPageVisible

Set to false to hide the repository settings page inside the settings dialog.

设置为false可在设置对话框中隐藏存储库设置页面。

AllowRepositoriesForOfflineInstaller

Set to false to disable usage of any temporary or user configured repositories set for offline installers. The maintenance tool written by an offline installer can still access the repositories. Defaults to true.

设置为false可禁用为脱机安装程序设置的任何临时或用户配置的存储库。离线安装程序编写的维护工具仍然可以访问存储库。默认为true。

AllowSpaceInPath

Set to false if the installation path cannot contain space characters.

如果安装路径不能包含空格字符,则设置为false。

DependsOnLocalInstallerBinary

Set to true if you want to prohibit installation from an external resource, such as a network drive. This might make sense for e.g. very big installers. The option is only used on Windows.

如果要禁止从外部资源(如网络驱动器)安装,请设置为true。这可能对大型安装人员有意义。该选项仅在Windows上使用。

TargetConfigurationFile

Filename for the configuration file on the target. Default is components.xml.

目标上配置文件的文件名。默认值为components.xml。

AliasDefinitionsFile

Filename for a XML document containing the definitions for component aliases. For more information about how to declare component aliases in the file, see Alias Definition File.

​包含组件别名定义的XML文档的文件名。有关如何在文件中声明组件别名的详细信息,请参见别名定义文件。

Translations

List of translation files to be used for translating the user interface. To add several translation files, specify several <Translation> child elements that each specify the name of the translation. Optional. For more information, see Translating Pages and Configuring and Overwriting Default Translations.

​用于翻译用户界面的翻译文件列表。要添加多个翻译文件,请指定几个<translation>子元素,每个子元素都指定翻译的名称。可选。有关更多信息,请参阅翻译页面和配置和覆盖默认翻译。

UrlQueryString

This string needs to be in the form "key=value" and will be appended to archive download requests. This can be used to transmit information to the webserver hosting the repository.

此字符串需要采用“key=value”的形式,并将附加到存档下载请求中。这可用于将信息传输到托管存储库的Web服务器。

ControlScript

Filename for a custom installer control script. See Controller Scripting.

​自定义安装程序控制脚本的文件名。请参阅控制器脚本。

CreateLocalRepository

Set to true if you want to create a local repository inside the installation directory. This option has no effect on online installers. The repository will be automatically added to the list of default repositories.

如果要在安装目录中创建本地存储库,请设置为true。此选项对联机安装程序没有影响。存储库将自动添加到默认存储库列表中。

InstallActionColumnVisible

Set to true if you want to add an extra column into component tree showing install actions. This extra column indicates whether a component is going to be installed or uninstalled, or just stay installed or uninstalled.

如果要在显示安装操作的组件树中添加额外的列,请设置为true。此额外列指示组件是要安装还是卸载,或者只是保持安装还是卸载。

SupportsModify

Set to false if the product does not support modifying an existing installation.

如果产品不支持修改现有安装,则设置为false。

SaveDefaultRepositories

Set to false if default repositories <RemoteRepositories> should not be saved to MaintenanceToolName.ini. By default default repositories are saved. Not saving the repositories means than when you run maintenancetool there are no default repositories in use.

如果默认存储库<RemoteRepositories>不应保存到MaintenanceToolName.ini,则设置为false。默认情况下,会保存默认存储库。不保存存储库意味着当运行maintenancetool时,没有使用默认存储库。

AllowUnstableComponents

Set to true if other components are allowed to be installed although there are unstable components. A component is unstable if it is missing a dependency, has errors in scripts, and so on. Unstable components are grayed in the component tree, and therefore cannot be selected. By default, the value is false which means that the installation will be aborted if unstable components are found.

如果允许安装其他组件,但存在不稳定的组件,则设置为true。如果组件缺少依赖关系、脚本中有错误等,则该组件是不稳定的。不稳定的组件在组件树中显示为灰色,因此无法选择。默认情况下,该值为false,这意味着如果发现不稳定的组件,安装将被中止。

Command Line InterfacePackage Directory

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值