Search code examples
installationnsis

NSIS Error creating shortcut on desktop


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!


Solution

  • 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'