Panarchy
20th April 2009 06:34 UTC
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
thek
20th April 2009 07:52 UTC
Use the command CreateShortcut
Also read the doku about the command "SetShellVarContext" so you know the difference in behaviour (all Users/current user)
Panarchy
20th April 2009 08:02 UTC
Thanks, will do.
Panarchy
20th April 2009 08:18 UTC
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
thek
20th April 2009 08:39 UTC
Here's a simple sample:
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!
Panarchy
20th April 2009 12:53 UTC
Thanks, got it to work now.
You da man!
Panarchy
20th April 2009 13:10 UTC
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!
Afrow UK
20th April 2009 14:09 UTC
Help if you post your code.
Stu
Panarchy
20th April 2009 22:22 UTC
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
22nd April 2009 15:07 UTC
They were both of great help.