Example.nsi 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Name "StartMenu.dll test"
  2. OutFile "StartMenu Test.exe"
  3. XPStyle on
  4. Page directory
  5. DirText "This installer will create some shortcuts to MakeNSIS in the start menu.$\nFor this it needs NSIS's path." \
  6. "Please specify the path in which you have installed NSIS:"
  7. InstallDir "${NSISDIR}"
  8. Function .onVerifyInstDir
  9. IfFileExists $INSTDIR\makensis.exe +2
  10. Abort
  11. FunctionEnd
  12. Page custom StartMenuGroupSelect "" ": Start Menu Folder"
  13. Function StartMenuGroupSelect
  14. Push $R1
  15. StartMenu::Select /checknoshortcuts "Don't create a start menu folder" /autoadd /lastused $R0 "StartMenu.dll test"
  16. Pop $R1
  17. StrCmp $R1 "success" success
  18. StrCmp $R1 "cancel" done
  19. ; error
  20. MessageBox MB_OK $R1
  21. StrCpy $R0 "StartMenu.dll test" # use default
  22. Return
  23. success:
  24. Pop $R0
  25. done:
  26. Pop $R1
  27. FunctionEnd
  28. Page instfiles
  29. Section
  30. # this part is only necessary if you used /checknoshortcuts
  31. StrCpy $R1 $R0 1
  32. StrCmp $R1 ">" skip
  33. CreateDirectory $SMPROGRAMS\$R0
  34. CreateShortcut $SMPROGRAMS\$R0\MakeNSISw.lnk $INSTDIR\makensisw.exe
  35. SetShellVarContext All
  36. CreateDirectory $SMPROGRAMS\$R0
  37. CreateShortcut "$SMPROGRAMS\$R0\All users MakeNSISw.lnk" $INSTDIR\makensisw.exe
  38. skip:
  39. SectionEnd