1

I'm trying to use NSIS for installing my application. When trying to create shortcut on the desktop, it fails. this is the script relevant part i'm using:

SetOutPath "$INSTDIR"
File "${BIN_DIRECTORY}\app.exe"
CreateShortCut "$SMPROGRAMS\app\app.lnk" "$INSTDIR\app.exe"
CreateShortCut "$DESKTOP\app.lnk" "$INSTDIR\app.exe"

This is the log:

Extract: app.exe... 100%
Create shortcut: C:\Users\roeia\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\app\app.lnk
Error creating shortcut: E:\Users\roeia\Desktop\app.lnk

the path is correct, and i don't have any problem to create or modify files there. I'm using windows 7 64bit. Thanks for helping!

2 Answers 2

0

It might be a right problem: do you run the installer as admin?

Specifying RequestExecutionLevel in the script may help to do so:

RequestExecutionLevel admin ;try also with 'highest'
2
  • Trying admin/highest made no difference, still getting the errors. The default location of setup is on server, tried running it locally but the same results.
    – BiLaL
    Aug 31, 2014 at 17:11
  • Why is admin level required to create a link on the user's desktop?
    – jla
    Dec 15, 2015 at 19:51
0

Perhaps the use of \r in the executeable path is causing the problem. Try \r to avaoid character substitution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.