Link to home
Start Free TrialLog in
Avatar of kyleboca
kyleboca

asked on

How to have custom desktop icon using Inno Setup

I am using Inno Setup for the first time and I am not familiar with scripting syntax at all. I have used the Inno Setup wizard to accomplish everything I need except the icon placed on the desktop is a generic Windows icon. The setup icon is custom and I would like the desktop icon to be custom as well.

Thanks in advance for your help.
Avatar of Mirtheil
Mirtheil
Flag of United States of America image

Attached is an example script (generated by InnoSetup) and it optionally creates a Desktop Icon.  I ran it and saw the icon of the EXE.  
How are you adding the Desktop Icon in your script?  Does your EXE have the proper icon in it?  
Sorry, here's the script:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "C:\util\innosetup\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent

Open in new window

Avatar of kyleboca
kyleboca

ASKER

Hi mirtheil,
The setup and uninstall icon are custom but the exe is generic.
ASKER CERTIFIED SOLUTION
Avatar of Mirtheil
Mirtheil
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks mirtheil. It worked perfectly.