Archive: install a desktop icon


install a desktop icon
I can't find documentation anywhere on how to have the NSIS installer create a Windows desktop icon for the user.

The shortcut is going into the start-menu just fine.

Can you help?

Thanks.


You use the same command - CreateShortCut, except instead of $SMPROGRAMS you use $DESKTOP. Like $SMPROGRAMS, it depends on SetShellVarContext to determine whether it's the current user's desktop only - or all users' (must be admin/etc. if on a limited account machine).


Thanks, that works, but the icon has no picture associated with it, as it does when I create a shortcut from my program executable by hand.


If there is no icon present then your path must be incorrect or you are setting an icon yourself which is incorrect.

Stu


Here is the line in my .nsi file:

CreateShortCut "$DESKTOP\Program.lnk" "$INSTDIR\Program.exe" "" 0

An icon is placed on the desktop.

There is no icon associated with it.

Although, the correct icon is shown when I create the shortcut by hand, not using NSIS.

Any clues?


so why set the icon to 0?

all you need is: CreateShortCut "$DESKTOP\Program.lnk" "$INSTDIR\Program.exe"


>>so why set the icon to 0?

Because I'm dense?

Hey, removing the zero worked!

Thanks for the help :)