Old 3rd December 2008, 15:47   #1
teebird
Junior Member
 
Join Date: Dec 2008
Posts: 9
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.
teebird is offline   Reply With Quote
Old 3rd December 2008, 17:50   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
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).
Animaether is offline   Reply With Quote
Old 3rd December 2008, 19:05   #3
teebird
Junior Member
 
Join Date: Dec 2008
Posts: 9
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.
teebird is offline   Reply With Quote
Old 3rd December 2008, 21:32   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If there is no icon present then your path must be incorrect or you are setting an icon yourself which is incorrect.

Stu
Afrow UK is offline   Reply With Quote
Old 4th December 2008, 07:02   #5
teebird
Junior Member
 
Join Date: Dec 2008
Posts: 9
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?
teebird is offline   Reply With Quote
Old 4th December 2008, 07:26   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
so why set the icon to 0?

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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 4th December 2008, 16:35   #7
teebird
Junior Member
 
Join Date: Dec 2008
Posts: 9
>>so why set the icon to 0?

Because I'm dense?

Hey, removing the zero worked!

Thanks for the help
teebird is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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