Skip to content
⌘ NSIS Forum Archive

Problem using createShortcut

5 posts

bambou51#

Problem using createShortcut

When I use the createShortcut command the shortcut that is created is not working because of a wrong initialisation of the field "Start in" (in french it is "Démarrer dans" - second field of the sortcut property dialog).
How to force this field content to a specific path ?

Here is how I create a shortcut :
SetOutPath "$my_inst_path"
CreateDirectory "$SMPROGRAMS\$SHORTCUT_FOLDER"
CreateShortCut "$SMPROGRAMS\$SHORTCUT_FOLDER\my_link.lnk" "$my_inst_path\my_exe.exe"
bambou51#
that's already what I am doing in my code.
It is like I have the content of $INSTDIR in my "Start in" field even when using SetOutPath "$my_inst_path" just before...
AlabamaPaul#
Re: Problem using createShortcut

If the path has spaces, the problem might be that you need to enclose the executable with double quotes. Try something like this ...
CreateShortCut "$SMPROGRAMS\$SHORTCUT_FOLDER\my_link.lnk" '"$my_inst_path\my_exe.exe"'
Red Wine#
I believe it might help you resolve this issue, if you try to debug it with shell link plugin,