Andriy Skolozhabskiy
Andriy Skolozhabskiy

Reputation: 81

Inno Setup - the icon on a desktop is not presented

I had been project in Inno Setup. All is installed perfectly, but the icon on a desktop is not presented - white color of icon.

#define MyAppName "My Program"
#define MyAppVersion "3.2.0"
#define MyAppVersionName "My Program 3 (64-bit)"
#define MyAppExeName "myprogram.exe"

..................

[Setup]
SetupIconFile=C:\Users\path_to_my_program\myprogram_Icon.ico

................

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppVersionName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

If I had been write section [Icons]:

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

then I get icon on desktop perfectly after installed.

How can I solve it problem?

Thank you very much.

Upvotes: 1

Views: 1934

Answers (1)

RobeN
RobeN

Reputation: 5456

If the EXE does not have a default application icon, then you should copy/install the Icon File along with the EXE and use the IconFileName parameter from [Icons] section to specify the path to it:

[Files]
Source: "C:\Users\path_to_my_program\myprogram_Icon.ico"; DestDir: "{app}" 

[Icons]
Name: "{commondesktop}\{#MyAppVersionName}"; Filename: "{app}\{#MyAppExeName}"; 
  IconFileName: "{app}\myprogram_Icon.ico"; Tasks: desktopicon

Upvotes: 1

Related Questions