使用NSIS创建快捷方式

时间:2014-02-06 16:50:51

标签: nsis shortcut

我正在尝试使用NSIS创建一个安装程序,只安装我制作的程序工作得很好但是当我在脚本中添加代码来安装快捷方式时,事情也无法正常工作。

我是这个程序的新手,会发生什么是“开始于:”属性路径不完整但如果我在最后添加“\ IndieBrowser \ IndieBrowser \ bin \ Debug \ IndieBrowser.exe”“很多东西都放进了文件夹。

完整代码:

!include "MUI2.nsh"

!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Section "Desktop Shortcut" SectionS
    SetShellVarContext current
    SetOutPath "$INSTDIR"
 CreateShortCut "$DESKTOP\IndieBrowser.lnk" "$INSTDIR\IndieBrowser\IndieBrowser\bin\Debug\IndieBrowser.exe"

SectionEnd

1 个答案:

答案 0 :(得分:1)

以下是一个例子:

; Create application shortcut (first in installation dir to have the correct "start in" target)
SetOutPath "$INSTDIR\bin"
CreateShortCut "$INSTDIR\bin\${NAME}.lnk" "$INSTDIR\bin\${NAME}.exe"

; Start menu entries
SetOutPath "$SMPROGRAMS\${NAME}\"
CopyFiles "$INSTDIR\bin\${NAME}.lnk" "$SMPROGRAMS\${NAME}\"
Delete "$INSTDIR\bin\${NAME}.lnk"
相关问题