cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peterbi
Level 7

How to remove icon of a shortcut from desktop

Hi,

IS Script MSI project with IS 2008.

I started the project by converting from DevStudio9 to IS2008. There is one issue: after upgrading using my new build on top of a previous release, every thing is fine. But when I do uninstall, a shortcut icon is left on desktop. The shortcut folder and the linked file have been removed in the uninstall. If I clicke on the icon, it will pop up error saying the linked file/folder doesn't exist or things like. When I tried install/uninstall on both of the previous release and my new build, all works fine: the shortcut (including icon at desktop) is created at install and removed at uninstall.

I know the AddFolderIcon() and DeleteFolderIcon() worked in the code, but why is the icon left on desktop? Can I force it to be removed (after uninstall)?

Thanks,
Peter
Labels (1)
0 Kudos
(4) Replies
Darain
Level 6

Is it on XP or Vista?

I found one similar case on Vista Home Basic where the shortcut appeared to be staying on the desktop after uninstall but in fact had been removed. Somehow the destop was not refreshed with the change. That's why when you clicked it it issued the "...doesn't exist..." message.

Finally, I updated that Vista with latest patches from MS and the problem was gone. Can't promise it will work on your case since it is a wierd behaviour. Maybe you just try.
0 Kudos
RobertDickau
Flexera Alumni

How was the shortcut created, with AddFolderIcon? If so, in what event are you calling RemoveFolderIcon? And which kind of upgrade?
0 Kudos
MattQVI
Level 8

In my case, the desktop shortcut was created by my basic MSI install (meaning that I added it to the Shortcuts under System Configuration). The DeleteFolderIcon did work for the desktop icon (would have gotten an error message otherwise) but I had to press F5 to refresh the screen. Any way to simulate that? Thanks.
0 Kudos
phill_mn
Level 7

Windows OS has an Icon Cache which needs to be reset. It is located at "%localappdata%\IconCache.db" You may find more info on Google.
0 Kudos