home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Contrib / StartMenu / Example.nsi next >
Text File  |  2003-03-18  |  1KB  |  49 lines

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