문제

I am trying to create an installer using NSIS, installing just the program that I have made works just fine but when I add code to the script to install a shortcut as well things aren't working.

I am very new to this program and what happens is the "Start in:" property path is incomplete but if i add the "\IndieBrowser\IndieBrowser\bin\Debug\IndieBrowser.exe"" at the end it just turns a lot of things into folders.

Full code:

!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
도움이 되었습니까?

해결책

Here is an example:

; 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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top