Archive: How to make a Shortcut


How to make a Shortcut
Hi, I'm new to this program and I was wondering how you would make it so that the installer would make a shortcut on the desktop after the files are installed. I have searched around and I am puzzled on what to do. Any help will be appreciated. Thanks

P.S.
I found this and I don't know what to do with it or where to put it...

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

just put it on a section

...or if you are talking about a checkbox on the finish page (Using Modern UI), you would use a function callback, see the Modern UI docs for info about that


Alright, All I need now is to know what section of what .NSI to put it in, Base or Modern. Also, I am just going to make it do it automatically so they don't need to check any boxes.

I did say I was new to this right? haha


you can simply use a section just for the creation of a shortcut

Section "Create Desktop-Shortcut"
CreateShortCut "$DESKTOP\Program.lnk" "$INSTDIR\Program.exe" ""
SectionEnd


that way the user can enable or disable it, which is recommended

also have a look at Sections for further options

Originally posted by whoops

I did say I was new to this right? haha
Maybe you should take some time and look at some of the examples that ship with nsis then

Ok, I figured out where to put it and makes the shortcut, but the shortcut doesn't work. When I click on it, it says that it can't find the file that its supposed to run. I tried a few things like changing the directory and stuff but I don't know what to do from here.

Originally posted by Anders
Maybe you should take some time and look at some of the examples that ship with nsis then
I did and I couldn't figure out this so, I asked on here