How to set the uninstall icon in Windows 11?

163 views
Skip to first unread message

Eric To

unread,
Feb 28, 2024, 11:12:33 PM2/28/24
to innosetup
I tried the followings:


#define MyAppName "helloworld"
[Setup]
UninstallDisplayIcon={app}\{#MyAppName}.ico
UninstallDisplayIcon={app}\{#MyAppName}.exe

[Icons]
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: "{app}\{#MyAppName}.ico"
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: "{app}\helloworld.ico"
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: {app}\helloworld.ico
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: {commonpf}\{#InstallPath}\helloworld.ico


The uninstall shortcut would either use the same icon as my application or would show without an icon. Even under Settings > Apps, it would just be a dummy generic square icon... I cannot specify my own icon, I even manually put one in the installed folder such as helloworld.ico.

What gives...?



michael....@gmail.com

unread,
Jul 24, 2024, 8:36:05 AM7/24/24
to innosetup
have the same problem. Any solutions?

Gavin Lambert

unread,
Jul 24, 2024, 10:29:38 PM7/24/24
to innosetup
On Thursday, February 29, 2024 at 5:12:33 PM UTC+13 Eric To wrote:
[Setup]
UninstallDisplayIcon={app}\{#MyAppName}.ico
UninstallDisplayIcon={app}\{#MyAppName}.exe

These affect the icon shown in Programs and Features, not the icon of the actual unins*.exe file on disk.  The latter icon will always be the same as the SetupIconFile, due to the way that the uninstaller is created.
 
[Icons]
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: "{app}\{#MyAppName}.ico"
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: "{app}\helloworld.ico"
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: {app}\helloworld.ico
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; IconFilename: {commonpf}\{#InstallPath}\helloworld.ico

Any one of these should work to set the icon of the shortcut (provided that you actually install the corresponding icon file).  It will not affect the unins*.exe file itself.

Note that Windows will hide uninstall icons from the Start Menu by default, because you're not supposed to be creating them any more.  You should adjust your documentation to tell people to use Programs and Features instead, then remove the uninstall shortcut from your script.
Reply all
Reply to author
Forward
0 new messages