addIcons method
void
addIcons({})
Adds an Icon
entry to the Inno Setup script.
name
, fileName
, and parameters
are required. workingDir
, hotKey
,
comment
, iconFilename
, iconIndex
, appUserModelID
,
appUserModelToaseActivatorCLSID
, and flags
are optional. tasks
is
optional.
Implementation
void addIcons({
required String name,
required String fileName,
List<String>? parameters,
String? workingDir,
List<String>? hotKey,
String? comment,
String? iconFilename,
String? iconIndex,
String? appUserModelID,
Uuid? appUserModelToaseActivatorCLSID,
List<IconFlag>? flags,
List<String>? tasks,
}) {
String iconsPart = [
'Name: "$name"',
'Filename: "$fileName"',
if (parameters != null && parameters.isNotEmpty)
'Parameters: "${parameters.join(' ')}"',
if (workingDir != null) 'WorkingDir: "$workingDir"',
if (hotKey != null && hotKey.isNotEmpty) 'HotKey: "${hotKey.join('+')}"',
if (comment != null) 'Comment: "$comment"',
if (iconFilename != null) 'IconFilename: "$iconFilename"',
if (iconIndex != null) 'IconIndex: "$iconIndex"',
if (appUserModelID != null) 'AppUserModelID: "$appUserModelID"',
if (appUserModelToaseActivatorCLSID != null)
'AppUserModelToastActivatorCLSID: "$appUserModelToaseActivatorCLSID"',
if (flags != null && flags.isNotEmpty) 'Flags: "${flags.join(' ')}"',
if (tasks != null && tasks.isNotEmpty) 'Tasks: ${tasks.join(' ')}'
].join('; ');
if (_icons.isEmpty) {
_icons.writeln('[ICONS]');
_icons.writeln(iconsPart);
} else {
_icons.writeln(iconsPart);
}
}