Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to refresh icons without rebooting?


5 replies to this topic

HermioneJJ

HermioneJJ
  • Members
  • 27 posts

Posted 21 April 2006 - 10:12

Hi all,
In my installer it contains a mergemodule which has a dll to register my extension, originally I added a *.reg file to the Component dll "REG File To Merge At Build" to write the info to registry...the problem is when it un-installs the old version product and then installs the new one...the old icons on the Desktop are not updated, but open the dialog to select a *.* file, in the Open dialog, the new icon is used.
After reboot, the icons can be update...but I don't want that...I don't want to ask the user to reboot just because the icons haven't refreshed
And I have tested if use 'regsvr32' to register the dll after install, the icons can be refreshed...but I can't find a way in IS to register it to make icons refresh without rebooting...I have tested to use self-register and add the dll to the self-reg table.It doesn't work.
Does anyone know how to resolve this problem?

Thanks
Cai xiaoqing-Hermione


antyagi

antyagi
  • Full Members
  • 121 posts

Posted 21 April 2006 - 10:47

Try deleting IconCache file.
Or if there is any other better way (thru code) i would love to know that.
  ankur tyagi

HermioneJJ

HermioneJJ
  • Members
  • 27 posts

Posted 21 April 2006 - 11:45

Thanks, antyagi!
Could you please tell me how to deleting IconCache file? I don't know where is it.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 22 April 2006 - 03:42

There is a windows message that can be sent to refresh the icons (at least on the desktop). I don't have access to the code for this at the moment, but this would be significantly cleaner than deleting the cache!
Regards
-Stein Åsmul

HermioneJJ

HermioneJJ
  • Members
  • 27 posts

Posted 24 April 2006 - 14:44

Thanks.
I have test the function SHChangeNotify...it only works when you un-install the product and delete the key [ HKEY_CLASSES_ROOT\**file\DefaultIcon]...it can refresh the icon to system's default unknow icon.
But it doesn't work in my problem. un-install the old and then install the new one the icon still the old..however I fixed it by another way.That is:
Change the Dll which contains the icons and so, the value of the key [ HKEY_CLASSES_ROOT\**file\DefaultIcon] different between the old and the new...in that way the IconCache changed. And system will show up new icon without reboot.


antyagi

antyagi
  • Full Members
  • 121 posts

Posted 04 May 2006 - 12:09

yes, ChangeNotify is a cleaner approach.
by the way what arguments you have passed to SHChangeNotify?
  ankur tyagi