Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using inno setup uninstall default icon

I am using Inno setup adding an uninstall icon to Start Menu Foulder.

using the Inno Setup Script Wizard (example My program), there is a default uninstall iconenter image description here

this is the code of example.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.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={{9BBC9685-FB4E-4BF1-B2B4-07A46B467911}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\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: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

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

I wish to use the same Uninstall default icon inside my software in order to avoid to download icon from internet or create an my own icon.

the code of my inno setup software is the following. Using this code the Uninstall icon is the same icon of .exe.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Remove xyz-duplicate LiDAR points"
#define MyAppVersion "0.2 Beta"
#define MyAppExeName "remove_duplicate_xyz_executable_project.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={{73F937B9-0CD9-44F1-B07E-17CD2399EE13}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=Remove xyz-duplicate LiDAR points
SetupIconFile=C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\iconRemoveduplicate_two_80res_small.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\_ctypes.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\_hashlib.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\_socket.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\_ssl.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\bz2.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\library.zip"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\python27.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\remove_duplicate_xyz_executable_project.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\select.pyd"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\PythonScript\Script_fun\Remove_duplicate_xyz\LiDAR_Remove_xyz_Duplicate_Point_executable_project\dist\unicodedata.pyd"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
like image 619
Gianni Spear Avatar asked Apr 05 '13 23:04

Gianni Spear


People also ask

How do I change the icon on my Inno?

As you know the application icon is built into the .exe file. The Inno Setup cannot modify the .exe files. And there's no other way to override the application icon by an external one. You have to edit the .exe file yourself, before building the installer.

What is the use of Inno Setup?

InnoSetup is an open source compiler to create installers on windows. It is free and provides a rich feature set. You can create professional looking installers for the end user. In this article we will explain you the basic concepts and steps involved in creating a simple setup of your C# Project.

Is Inno Setup open source?

Inno Setup grew popular due to being free and open source; free for both commercial and non-commercial use, many software companies switched to the tool.


1 Answers

If you set SetupIconFile then the Uninstall Exe File (e.g. unins000.exe) will have exactly same icon implemented. One way to override displaying of this icon is setting custom UninstallDisplayIcon in [Setup] section for Control Panel Add/Remove list and IconFileName in [Icons] section for shortcuts placed on Desktop, Start Menu, etc. In both cases you have to have your custom Icon file which has to be installed with your app.

[Setup]
SetupIconFile=C:\mysourcedir\mysetup.ico
UninstallDisplayIcon={app}\myuninstall.ico 
                        //overrides icon on Add/Remove List in Control Panel

[Files]
Source: "C:\mysourcedir\myuninstall.ico"; DestDir: "{app}"

[Icons]
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}";
 IconFilename: "{app}\myuninstall.ico" 
                       //overrides icon in Start Menu shortcut

The second one is to have precompiled unins000.exe with specific icon implemented. It can be tricky though in some cases (multiple install with unins001, unins002, etc.; custom code features)

like image 53
RobeN Avatar answered Oct 22 '22 00:10

RobeN