Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread Display Modes
Old 31st March 2014, 16:27   #1
Junior Member
Join Date: Feb 2014
Posts: 4
Post NSIS CreateShortcut- Icon not visible to other users on same PC

Hi, I am using nsis to create an installer for my java application (.jar) and I have 2 questions regarding Shortcut icons.

The installer that my nsis script creates successfully installs my application on user PC's and creates a shortcut to the application in the Start Menu. My first question is something I have noticed recently.
On some PC's [including my own], the shortcut is created and the icon (.ico) image is displayed alongside it perfectly. However, some users have mentioned that the shortcut in the Start Menu on their PC's still has the default java .jar file icon next to the shortcut link. Does anyone know why this could be happening ?

My second question is this:
If my application is installed by an admin user of a PC and other users then login and try to use it, they can see the Shortcut to the application but in these cases, they see no icon next to the shortcut [not even the java .jar file icon] ? It seems as if the installer is unable to set the icon for all users [even though my nsis script uses "SetShellVarContext all" before creating the shortcut]. I would'vew thought it would at least default to the java .jar file icon.

If anyone has any suggestions or feedback on how to fix these issues, please let me know soon. Thanks.
AjitPS is offline   Reply With Quote
Old 31st March 2014, 17:59   #2
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,370
When creating a shortcut it is important that the target and the .ico exists before you create the shortcut.

The second issue sounds like a permission issue.

InstallDir "$ProgramFiles\MyApp"

SetShellVarContext all
SetOutPath $instdir
File MyApp.jar
File MyApp.ico
CreateShortcut "$smprograms\myapp.lnk" "c:\whatever\java.exe" '-jar "$instdir\MyApp.jar"' "$instdir\MyApp.ico" 0

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

icon, nsis, shortcut

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump