Archive: File Association - Icon problem


File Association - Icon problem

Originally posted by Comperio
http://nsis.sourceforge.net/wiki/File_Association
i've used this examle to assign icons to my files, but i have problem. explorer does not show my icons. it shows default system icons instead. does theese icons have to meet some special needs?? the wired thing is that, when i enter folder options in the explorer and browse file types, my files are shown with orrect icons.

Hi, have you tried to hit "F5" when in Explorer ? Maybe all is needed is just a refresh.

KenA


Originally posted by KenA
Hi, have you tried to hit "F5" when in Explorer ? Maybe all is needed is just a refresh.

KenA
well yes, i did. this does not help. althouh when i run my application and when browse with it for files to open my icons are displayed... what's more, theese icons are not the ones i specified inside the installer (WriteRegStr HKCR "myapp\DefaultIcon" "" "$INSTDIR\myapp.exe,3") providing apropriate icon index.

it looks like there is something wrong with my icons. does anyone know if the icons need to be in some exact format (size, colors)?

Ah. I don't know if it helps, but you can find some info about icon's format in Widnows here here.

KenA


Originally posted by KenA
Ah. I don't know if it helps, but you can find some info about icon's format in Widnows here here.

KenA
thanks, but this is not what i needed.
something more technical on embeding icons in applications would be helpful. now i'm digging through msdn.com but can't find anything useful.

Little off topic:
I'm not sure where you got the link "Originally posted by Comperio" message in your original post, but near as I can tell, I've not been involved at all in this discussion. (???)

Back to your issue:
Before pulling your hair out with troubleshooting NSIS, it may be worthwhile to take a step back and make sure that you can assign the icon properly in Windows by manually editing your file types. (You don't say what version of Windows, but assuming Windows XP, you can to to TOOLS and FOLDER OPTIONS, click on the FILE TYPES tab to get a list of all known extension. Simply pick the extension you need to edit and click on the 'advanced' button. From there, you can change the icon.) You could also create a manual shortcut from within Explorer and assign the icon there.

If the icons work properly in Windows, then you know there is nothing wrong with your EXE's icons.

Also: this plugin may help refresh explorer after changing the icon in your installer.

And a few links from MS:
http://support.microsoft.com/kb/q132668/

http://msdn.microsoft.com/library/de...winxpicons.asp

and finally an interesting forum article from MSDN:
http://forums.microsoft.com/MSDN/Sho...70920&SiteID=1


I'm having the same problem.. I've searched the internet for a long time, but I didn't find a solution until now... I hope this thread is going to enlight my 'problem'.


I'm having the same kind of problem. On one computer the icon apears correctly, and on another I've got the default windows exe icon. After having done several trials and check everything, it seams that it does this as soon as the intall file is bigger than 200 Mb like (i.e. with the same install script, the icons appears when the install file is not too big). Don't know if it comes from windows (probably) or from NSIS.


halutotale, the two problems aren't related. Your problem is a known issue. Windows sometimes skips icons of files that large. Search the forum for more information on this.


I'm having the same problem...

/me on win xp 64


To get around the problem described in the first post, use this code after creating the association:

!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'