I am having problems with CreateShortcut: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page.)
 
(the 'c' in cut was not capital, will stop text highlighting in notepad++)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Make sure you have separated the parameters from the target file.
Make sure you have separated the parameters from the target file.


For example, if you want to create a shortcut to notepad with $INSTDIR\Readme.txt as a parameter don't use:
For example, if you want to create a shortcut to notepad with $INSTDIR\Readme.txt as a parameter, don't use this:


<highlight-nsis>
CreateShortcut "myshortcut.lnk" "notepad.exe $INSTDIR\Readme.txt"
CreateShortcut "myshortcut.lnk" "notepad.exe $INSTDIR\Readme.txt"
</highlight-nsis>


Use two separate strings:
Instead, use two separate strings:


CreateShortcut "myshortcut.lnk" "notepad.exe" "$INSTDIR\Readme.txt"
<highlight-nsis>
CreateShortCut "myshortcut.lnk" "notepad.exe" "$INSTDIR\Readme.txt"
</highlight-nsis>


[[Category:Scripting FAQ]]
[[Category:Scripting FAQ]]

Latest revision as of 04:02, 14 February 2008

Make sure you have separated the parameters from the target file.

For example, if you want to create a shortcut to notepad with $INSTDIR\Readme.txt as a parameter, don't use this:

CreateShortcut "myshortcut.lnk" "notepad.exe $INSTDIR\Readme.txt"

Instead, use two separate strings:

CreateShortCut "myshortcut.lnk" "notepad.exe" "$INSTDIR\Readme.txt"