1

I installed my icon with

Name: "{commondesktop}\TestApp {#VERSION}"; Filename: "{app}\TestApp.exe"; WorkingDir: "{app}"; IconFilename: "{app}\TestApp.ico";

and if I update my tool (checked in InitializeSetup()) the old icon is still available on desktop (old version number) and the new one also!

Is there a flag to remove the icon if the tool will be updated and not uninstalled?

thx

leon22
  • 5,280
  • 19
  • 62
  • 100

2 Answers2

4

This is one of the reasons why you should generally not include the version number in your icon names.

You can, however, tell Inno to delete these in a later install like so:

[InstallDelete]
Type: files; Name: "{commondesktop}\TestApp 5.2.lnk"

Note that it is best practice to individually name all the previous versions that you have released, instead of using a wildcard. (This is because a wildcard might accidentally delete other icons that the user has created themselves, which they won't be happy about.)

Miral
  • 12,637
  • 4
  • 53
  • 93
0

Aparently, even if you delete and recreate shortcut link as in Miral's answer, Windows still takes exe icon from some cache. There is another way. Ship separate .ico file within your installer, and then use IconFilename parameter in [Icons] section to target that icon instead of the one in the exe.