replace same shortcut from desktop innosetup

inno-setup

Solution

In this case you should check the location of both shortcuts.

Probably one of them is created in Public Desktop folder (for all users) - `{commondesktop}` and the second is presonalized for Current User Desktop folder - `{userdesktop}`.

A.

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

B.

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

Problem

There is already a shortcut on the desktop with same name but it was installed by a setup by setupfactory( i want to replace it with inno). now when i install using a setup created by innosetup it creates a new icon rather than replacing the current one . i added the [installDelete] section but doesnt work. I just checked the shortcut properties. the diff i found is one shortcut has owner as administrators group and the other one is my user. but both was installed by the same user. would that be the reason? is there any workaround for this? or can i check if a shortcut with same name exists? Thank you Both are pointing to the same exe in same path. I m installing in windows 7

Original source