Skip to content
⌘ NSIS Forum Archive

Application icon appears blank when installed for the first time

6 posts

sajaskk#

Application icon appears blank when installed for the first time

I created a setup for my application using NSIS. I had added an icon to my exe file using resource file. Besides that in the NSIS script I created the shortcut like this:

CreateShortCut "<Link_Path>" "<Exe_Path>" "" "<Icon_Path>" "" "" "" "<Application_Name>"
When I install the application using the generated setup for the first time in a (32 bit ) machine, the icon for the application appears blank in the start menu recent application section. But the shortcut created and the application link in the start>All_Programs folder has the icon.

But when I reinstall the application, the icon appears for the start menu recent application section as well.
Afrow UK#
Make sure the application executable file is extracted before creating the short cut.

Stu
sajaskk#
Originally Posted by Afrow UK View Post
Make sure the application executable file is extracted before creating the short cut.

Stu
Thanks for the reply. I was extracting the files after setting the shortcut. I have made the changes in the script. But I am unable to test it in my system as I have already installed the application once. The issue used to happen only during the first installation. Is there any way to reproduce the issue in my PC itself? I tried changing the ico file, but the icon got updated in the first try itself.
sajaskk#
Thank you. I tried the installer on different PC's. It's working fine. But after clearing the icon cache, I am not getting the icon unless until i restart the explorer.exe process. Anyway, it's working fine for frseh installations currently. Thanks a lot.
JasonFriday13#
Usually the order is: files, uninstaller, registry, shortcuts. After creating all your shortcuts, try putting this in:
!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'