我正在编写一个脚本,要求用户选择要安装应用程序的哪些部分:
仅应用程序、仅数据库引擎、仅数据或这些的任意组合。
我知道我应该使用[Components]
部分来定义这些,但我对类型、组件和任务之间的相互作用感到困惑 - 首先,我认为[Tasks]
用于“额外”安装,但后来我看到了明确链接这三个的代码。
谁能向我指出它们如何协同工作的一个很好的解释? - 我确信有一个...
Thanks
成分由一个或多个组成Types。在脚本中您将使用成分作为选择器取决于Type由最终用户选择。成分可以用在Tasks因为取决于Types由用户选择aTask将被执行或不被执行。
例如:
; '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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)