Mohammad Sheykholeslam
Mohammad Sheykholeslam

Reputation: 1437

No icon with Inno Setup

I have a application that executes normally. But when I make a setup file with Inno Setup no icon is displayed. The setup script is:

; Script generated by the Inno Setup Script Wizard.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName       "MyApp"
#define MyAppVersion    "1.0"
#define MyAppExeName    "MyApp.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C1DD3B91-BDCD-45CC-BFCA-C52DD39A6631}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName=C:\Inno Setup Studio\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir=C:\Inno Setup Studio\MyApp
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "Do you want to create desktop icon?"; Flags: checkablealone

[Files]
Source: "C:\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion

Source: "Requirements\msvcp100.dll"; DestDir: "{app}"
Source: "Requirements\msvcp100d.dll"; DestDir: "{app}"
Source: "Requirements\msvcr100.dll"; DestDir: "{app}"
Source: "Requirements\msvcr100d.dll"; DestDir: "{app}"
Source: "Requirements\PocoFoundation.dll"; DestDir: "{app}"
Source: "Requirements\PocoFoundationd.dll"; DestDir: "{app}"
Source: "Requirements\QtCore4.dll"; DestDir: "{app}"
Source: "Requirements\QtCored4.dll"; DestDir: "{app}"
Source: "Requirements\QtGui4.dll"; DestDir: "{app}"
Source: "Requirements\QtGuid4.dll"; DestDir: "{app}"
Source: "Requirements\QtNetwork4.dll"; DestDir: "{app}"
Source: "Requirements\QtNetworkd4.dll"; DestDir: "{app}"
Source: "Requirements\QtService.dll"; DestDir: "{app}"


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

Do you know whats wrong?

Upvotes: 4

Views: 11126

Answers (4)

MacKey
MacKey

Reputation: 45

The space character in the name of the directory where the icon file is located may be causing this problem. If the icon file is under, for example, the 'my images' directory, the program does not see it. You can try not using unacceptable characters such as spaces in the directory name.

Upvotes: 0

Stijn Sanders
Stijn Sanders

Reputation: 36840

If you are specifically looking for the icon used when listing the install in the list under the Add/Remove Program section of the configuration panel, use the UninstallDisplayIcon setting.

Upvotes: 1

John
John

Reputation: 101

I know this is an old post. But maybe this will help someone.

With inno, using something like the following, I was able to associate icons with the desktop shortcut(desktop.ico), the app launched from start(start.ico), the uninstall launched from start(uninst.ico), and the setup.exe(setup.ico).

Substitute your icon paths\names in place of e.g. C:\Temp\setup.ico. Substitute your app in place of MyApp.

In the [Setup] section:

SetupIconFile=C:\Temp\setup.ico

In the [Icons] section:

Name: "{group}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "C:\Temp\start.ico"

Name: "{group}\{cm:UninstallProgram,MyApp}"; Filename: "{uninstallexe}"; IconFilename: "C:\Temp\uninst.ico"

Name: "{commondesktop}\MyApp"; Filename: "{app}\MyApp.exe"; Tasks: desktopicon; IconFilename: "C:\Temp\desktop.ico"

Upvotes: 10

RobeN
RobeN

Reputation: 5456

Looking on your script I can say that there is [Icons] section missing. You have added [Tasks] with checkbox for Desktop Icon only.

You should add to your script something like:

[Icons] 
Name: "{commondesktop}\MyAppName"; Filename: "{app}\MyAppExeName.EXE";
 WorkingDir: "{app}"; Tasks: desktopicon

If the EXE file does not contain Icon or if you want to set you custom icon, you should additionally use flag: IconFileName: "{app}\CustomIconFile.ico"

Upvotes: 3

Related Questions