3

Possible Duplicate:
Wrong desktop shortcut icon on Windows 7 (Inno Setup)

I have an application deployed with an Inno Setup installer. When I perform an upgrade installation (i.e. run install-1.5.exe when version 1.0 is already installed), if my application binary is in-use (either my application is running, or perhaps some other process has locked the image file), I encounter icon cache corruption in Explorer after a reboot. Explorer shows a blank/default shortcut icon for my application on the desktop and Start Menu.

We have searched the internet and found a variety of "kitchen-sink" methods for refreshing the Explorer icon cache, none of which seem to be wholly reliable on all operating systems. So, we would prefer to figure out what causes this corruption in the first place and cure the disease rather than treating the symptoms.

This occurs in Windows Vista and Windows 7, but not in Windows XP.

In particular, the corruption "takes effect" whenever file associations are refreshed by Explorer. That might be immediate (if ChangesAssociations=yes is set in the Inno script), or later on.

Has anyone run into this before? We do not understand why this icon cache corruption comes about.

Community
  • 1
  • 1
DSII
  • 429
  • 6
  • 15
  • It turns out it is the same question as this: http://stackoverflow.com/questions/4400472/wrong-desktop-shortcut-icon-on-windows-7-inno-setup and we would like to know if there is a way to avoid this short of killing explorer, deleting the icon cache, and rebooting (not a very graceful solution for an installer). Thanks! – DSII Apr 09 '12 at 17:45

2 Answers2

1

Although it requires explorer.exe to be restarted, the following batch script does not require a reboot to be effective:

rebuild-icon-cache.bat

@echo off
taskkill /IM explorer.exe /F
cd /d %userprofile%\AppData\Local
del IconCache.db /a
start explorer.exe
MTCoster
  • 5,868
  • 3
  • 28
  • 49
0

Do following steps to clear Icon Cache of windows 7
1)Write in Command Line "cleanmgr"
2)Choose the local disk , in which your windows is. ("C:\" by default)
3)Wait...
4)Check the checkbox "Thumbnails" and uncheck all other checkboxes
5)End process "explorer.exe" from "Task Manager" (Ctrl+Shift+Esc by default)
6)Click "OK" button in cleanmgr , and wait.

Please vote, if this post helped you!

Searush
  • 628
  • 1
  • 5
  • 18