addTasks method
void
addTasks({})
Adds a Task
entry to the Inno Setup script.
name
and description
are required. groupDescription
is optional.
components
and flags
are optional.
Implementation
void addTasks({
required String name,
required String description,
String? groupDescription,
List<String>? components,
List<TaskFlag>? flags,
}) {
String tasksPart = [
'Name: "$name"',
'Description: "$description"',
if (groupDescription != null) 'GroupDescription: "$groupDescription"',
if (components != null && components.isNotEmpty)
'Components: "${components.join(' ')}"',
if (flags != null && flags.isNotEmpty) 'Flags: "${flags.join(' ')}"',
].join('; ');
if (_task.isEmpty) {
_task.writeln('[TASKS]');
_task.writeln(tasksPart);
} else {
_task.writeln(tasksPart);
}
}