1
votes

When I run my Inno Setup script, it always creates a desktop icon regardless of whether I check the "Create a desktop icon" or not.

Here is the applicable part of the script:

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}";   GroupDescription: "{cm:AdditionalIcons}"

[Icons]
Name: "{group}\{#MyAppName} "; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{#MyAppName} Users Guide"; Filename: "{pf32}\Ishmael\Ishmael 2.5\Ishmael 1.0 Users Guide.pdf";
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{pf32}\Ishmael\Ishmael 2.5\bin\SpermBlow.ico"

Thanks,

Curtis

1

1 Answers

1
votes

This entry in unconditional:

Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{pf32}\Ishmael\Ishmael 2.5\bin\SpermBlow.ico"

So it indeed always creates the icon, no matter if you check the "Create a desktop icon" or not. It's missing Tasks: desktopicon condition.


I'm not sure what you wanted to achieve by the two entries with the same name.

Maybe you just need to combine them to one:

Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; \
    IconFilename: "{pf32}\Ishmael\Ishmael 2.5\bin\SpermBlow.ico"; Tasks: desktopicon

The above will create the icon conditionally, based on the specified task, using a custom icon file.