Skip to content
⌘ NSIS Forum Archive

Creating DesktopShortcut

15 posts

2shepi#

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 👎[/edit]

tnx 4 supporting me...
kichik#
Welcome to the forum! 😁

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"
2shepi#
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...
kichik#
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.
2shepi#
kk now lets initialize our mind 😕

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 🧟
kichik#
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.
2shepi#
ok now works over.. ill take a look tomorrow nd will post the result. hope gonna get it! tnx 4 supporting me
2shepi#
hope smn gonna read this post at this time 😁

now i tested with the "InstallOptions.nsi" but when i compile "InstallOptions.nsi" i dont see any fields is this normal?
2shepi#
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?
Joost Verburg#
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?
2shepi#
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.
kichik#
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