Inno Setup-正确使用[类型],[组件]和[任务] [英] Inno Setup - Correct use of [Types], [Components] and [Tasks]

查看:50
本文介绍了Inno Setup-正确使用[类型],[组件]和[任务]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个脚本,要求用户选择要安装应用程序的哪些部分:

I am writing a script that requires users to choose which parts of the application to install:

仅应用程序,仅数据库引擎,仅数据或这些的任意组合.

Application only, DataBase Engine only, Data only, or any combination of these.

我知道我应该使用[Components]部分来定义这些内容,但是我对类型,组件和任务之间的相互作用感到困惑-一方面,我认为[Tasks]是用于额外"安装的,但随后我看到了明确链接这三个代码的代码.

I know I should be using the [Components] section to define these, but I am getting confused by the interplay between Types, Components and Tasks - for one, I thought [Tasks] was for "extra" installations, but then I saw code that links explicitly the three.

谁能给我一个很好的解释,说明它们如何协同工作? -我肯定有一个...

Can anyone point me to a good explanation of how these work together? - I am sure there is one...

谢谢

推荐答案

组件由一种或多种类型组成.在脚本中,您将根据最终用户选择的 Type 使用 Components 作为选择器.可以在 Tasks 中使用 Components ,因为根据用户选择的 Types 类型, Task 是否具有待执行.

Components are made of one or more Types. In the script you'll use the Components as selector depending on the Type chosen by the end user. Components can be used in the Tasks because depending on the Types chosen by the user a Task will have or not to be executed.

例如:

; 'Types': What get displayed during the setup
[Types]
Name: "full";     Description: "Full installation";
Name: "app";      Description: "Fapplication only";
Name: "dbengine"; Description: "Database engine only";
Name: "data";     Description: "Data only";

; Components are used inside the script and can be composed of a set of 'Types'
[Components]
Name: "full";     Description: "Full installation";   Types: full app dbengine app
Name: "app";      Description: "Fapplication only";   Types: app
Name: "dbengine"; Description: "Database engine only";Types: dbengine
Name: "data";     Description: "Data only";           Types: data

; Defines which files are setup, based on the differents components
[Files]
Source: "MyApp.exe";  DestDir: "{app}"; Flags: ignoreversion; Components: full app
Source: "ADll.dll";   DestDir: "{app}"; Flags: ignoreversion; Components: full app
Source: "Engine.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: full dbengine
Source: "data_0";     DestDir: "{app}"; Flags: ignoreversion; Components: full data
Source: "data_1";     DestDir: "{app}"; Flags: ignoreversion; Components: full data

; In the same fashion, a task can be set for a specific component
[Tasks]
Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; Components: full app

这篇关于Inno Setup-正确使用[类型],[组件]和[任务]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆