Archive: Desktop Shortcuts - How to make?


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


Use the command CreateShortcut

Also read the doku about the command "SetShellVarContext" so you know the difference in behaviour (all Users/current user)


Thanks, will do.


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


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!

Thanks, got it to work now.

You da man!


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!


Help if you post your code.

Stu


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


They were both of great help.