Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup - Correct use of [Types], [Components] and [Tasks]

Tags:

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.

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

Thanks

like image 672
LittleFish Avatar asked Jan 17 '12 07:01

LittleFish


1 Answers

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
like image 104
az01 Avatar answered Sep 25 '22 02:09

az01