Inno Setup - Correct use of [Types], [Components] and [Tasks]
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.
For example:
; '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
A complete explanation can be found on Innosetup help page : Components and Tasks Parameters
and [Components] section
I give you below a generic sample :
[Components]
Name: a; Description: a
Name: b; Description: b
[Tasks]
Name: p; Description: a or b; Components: a or b
Name: q; Description: a and b; Components: a and b
Name: r; Description: not a or b; Components: not a or b
Name: s; Description: not (a or b); Components: not (a or b)
Name: t; Description: a or b - old style; Components: a b
My understanding is that a Component is a basically a set of files - it constitutes a major 'component' of what can be installed. A 'type' of installation is a selection of components that it makes sense to install together. Here's the way I would code @az01 's example.
; Lists types of installations - the user is presented
; with a list containing these Descriptions:
[Types]
Name: "full"; Description: "Full installation";
Name: "app-only"; Description: "Application only";
Name: "engine-only"; Description: "Database engine only";
Name: "data-only"; Description: "Data only";
; This lists the installable components of the product and
; specifies which type of install they are included in
[Components]
Name: "app"; Description: "Application"; Types: full app-only
Name: "engine"; Description: "Database engine"; Types: full engine-only
Name: "data"; Description: "Data"; Types: full data-only
; each file is assigned to one component, unless it is shared between
; components, in which case maybe it should go in a 'shared' component.
[Files]
Source: "MyApp.exe"; DestDir: "{app}"; Flags:; Components: app
Source: "ADll.dll"; DestDir: "{app}"; Flags:; Components: app
Source: "Engine.dll"; DestDir: "{app}"; Flags:; Components: engine
Source: "data_0"; DestDir: "{app}"; Flags: ignoreversion; Components: data
Source: "data_1"; DestDir: "{app}"; Flags: ignoreversion; Components: data