Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 20th April 2009, 05:34   #1
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Desktop Shortcuts - How to make?

Hello

How do I make a desktop shortcut automatically within my .nsi script file?

The file is located in the WINDOWS directory.

The file 'installed'/extracted using the NSIS installer is an .exe

Please tell me how to add a Desktop Shortcut for my .exe

Thanks in advance,

Panarchy
Panarchy is offline   Reply With Quote
Old 20th April 2009, 06:52   #2
thek
Member
 
thek's Avatar
 
Join Date: Jun 2006
Location: Austria
Posts: 92
Use the command CreateShortcut

Also read the doku about the command "SetShellVarContext" so you know the difference in behaviour (all Users/current user)
thek is offline   Reply With Quote
Old 20th April 2009, 07:02   #3
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Thanks, will do.
Panarchy is offline   Reply With Quote
Old 20th April 2009, 07:18   #4
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Just tried, can't seem to work it out.

Just want to get the simplest method to work before work (custom icon, local user) before trying anything fancy.

Please tell me the exact command to use. I have only 1 .exe to link.

Thanks in advance,

Panarchy
Panarchy is offline   Reply With Quote
Old 20th April 2009, 07:39   #5
thek
Member
 
thek's Avatar
 
Join Date: Jun 2006
Location: Austria
Posts: 92
Here's a simple sample:
code:
CreateShortcut "$DESKTOP\My_Application.lnk" "$INSTDIR\My_application.exe"

This generates an icon with the name "My_Application" on the Deskotp, linking it to your installed exe, with the same icon than your exe.

If you want to have another icon, you have to embed it in your exe resources and select it with an index or install an additional icon file

But read the documentation
it only has 4 lines of text, it isn't that hard!
thek is offline   Reply With Quote
Old 20th April 2009, 11:53   #6
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Thanks, got it to work now.

You da man!
Panarchy is offline   Reply With Quote
Old 20th April 2009, 12:10   #7
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Unhappy

Didn't work... worked until I tried adding an icon;

pastebin.com/f33bc852a

It's giving me an error on line 23 (!insertmacro ExtractMaintainenceScript $WINDIR)

Please tell me how to get my Install script working again.

Thanks in advance,

Panarchy

EDIT: When I finally got it to work, with it's parameters and everything (including copying across the .ico file) all I got was a blank icon tried on Vista 64-bit and my 32-bit XP VMware Virtual Machine.

Please tell me how to get this to work!

Last edited by Panarchy; 20th April 2009 at 12:28.
Panarchy is offline   Reply With Quote
Old 20th April 2009, 13:09   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
Help if you post your code.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 20th April 2009, 21:22   #9
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Certainly.

I have sent a PM to both Afrow UK and thek.

Please have a read of it, and tell me what you can do to make my code work.

Thanks in advance,

Panarchy
Panarchy is offline   Reply With Quote
Old 22nd April 2009, 14:07   #10
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Arrow

They were both of great help.
Panarchy is offline   Reply With Quote
Reply
Go Back   Winamp 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