Archive: Creating DesktopShortcut


Creating DesktopShortcut
Hi

its the first day i work with nsis and i think its a great thing, but i couldnt find out how i could create Desktop Shortcuts...
could u help me out pls.

my nsi file
[edit by kichik]Please attach large scripts. attached below :down:[/edit]

tnx 4 supporting me...


Welcome to the forum! :D

To create a shortcut on the desktop use CreateShortcut with the $DESKTOP variable. For example (taken from <NSIS Dir>\Examples\makensis.nsi):
CreateShortCut "$DESKTOP\Nullsoft Install System.lnk" "$INSTDIR\NSIS.exe"


hi kichik
tnx 4 ur fast answer.
Not creating the shortcut is my problem, the problems comes up with generating a custompage!
When i declare a custompage the others, "pre defined" pages dont have any "pre defined" text. hope u could follow..

[edit]
Sorry 4 File pasting...


Sorry, lost you... If you want to create a custom page have a look at the InstallOptions.nsi example in Examples\Modern UI. But what does a custom page have to do with a desktop shortcut? Are you trying to give the user the option to create a desktop icon? If so, maybe you should create another section that will do it, just like in Examples\makensis.nsi.


kk now lets initialize our mind :confused:

From the beginning.
The User could choose which components will be installed, next screen he could choose, creating startmenu entries and in the next screen i wanne let the user choose creating a shortcut on his desktop. imho - i already said, the first day with nsis, so dont judge me - this have to be realize by a custompage.

Hope know u understand! sorry 4 :igor:


Then what you need is to have a look at the InstallOptions.nsi example in Examples\Modern UI. It will show you how to create a custom page, and how to read the user input from it.


ok now works over.. ill take a look tomorrow nd will post the result. hope gonna get it! tnx 4 supporting me


hope smn gonna read this post at this time :D

now i tested with the "InstallOptions.nsi" but when i compile "InstallOptions.nsi" i dont see any fields is this normal?


!insertmacro: macro named "MUI_FINISHPAGE" not found!

hm why?


is: !define MUI_FINISHPAGE


yes it is

!define MUI_FINISHPAGE
!define MUI_FINISHPAGE_RUN "$INSTDIR\maintlog.cmd"


i dont look trough.
!define mui_[pagename]

!insertmacro MUI_PAGECOMMAND_LICENSE

could i see anywhere which "macro" are real or so? couldnt follow, where does it get the license page and so?


What is exactly your problem? Why not add an an extra section, so the user can choose for a desktop shortcut on the components page?


ok now i did it with a section, the simplest way 4 me as a beginner.

My next problem - someone will know why im sure - is the startmenu entrie wouldnt be created.

could u have a look into my source pls! tnx.


Defining MUI_STARTMENUPAGE is not enough. You have to create the shortcuts too. Have a look at Examples\Modern UI\StartMenu.nsi and especially the part that starts with:
!insertmacro MUI_STARTMENU_WRITE_BEGIN