; Generated NSIS script file (generated by makensitemplate.phtml 0.21)
; by 212.244.86.91 on Mar 08 03 @ 04:31

; NOTE: this .NSI script is designed for NSIS v1.8+
!define VERSION="2.04rc1-2"

!define PROGRAM="mldonkey-ease${VERSION}"
!define SHORTNAME "mldonkey-ease"

Name "${SHORTNAME}"
OutFile ${SHORTNAME}2.04rc1-2-installer.exe
Icon "setup.ico"
;ChangeUI all modern.exe
Function .onInit
  SetOutPath $TEMP
  File /oname=spltmp.bmp "splash-mldonkey-ease-install.bmp"
	InitPluginsDir
; optional
; File /oname=spltmp.wav "my_splashshit.wav"

  advsplash::show 1000 600 400 -1 $TEMP\spltmp

  Pop $0 ; $0 has '1' if the user closed the splash screen early,
         ; '0' if everything closed normal, and '-1' if some error occured.

  Delete $TEMP\spltmp.bmp
;  Delete $TEMP\spltmp.wav
FunctionEnd


CRCCheck On
; Some default compiler settings (uncomment and change at will):
; SetCompress auto ; (can be off or force)
; SetDatablockOptimize on ; (can be off)
; CRCCheck on ; (can be off)
; AutoCloseWindow false ; (can be true for the window go away automatically at end)
; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
; SetDateSave off ; (can be on to have files restored to their orginal date)

LicenseText "You must agree to this license before installing."
LicenseData "gpl.txt"

ShowInstDetails Show
ShowUninstDetails Show
InstallColors /windows
InstallDir "$PROGRAMFILES\${SHORTNAME}"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${SHORTNAME}" ""
DirShow show ; (make this hide to not let the user change it)
DirText "Select the directory to install:"

Section "" ; (default section)
SetOutPath "$INSTDIR"
; add files / whatever that need to be installed here.
File "C:\mld_ease\*.*"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\${SHORTNAME}" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "DisplayName" "mldonkeyEASE (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "UninstallString" '"$INSTDIR\uninst.exe"'
; write out uninstaller
WriteUninstaller "$INSTDIR\uninst.exe"
SectionEnd ; end of default section

; optional section
Section "Start Menu Shortcuts"
  CreateDirectory "$SMPROGRAMS\${SHORTNAME}"
  CreateShortCut "$SMPROGRAMS\${SHORTNAME}\mldonkey 2.03.lnk" "$INSTDIR\run_mldonkey.exe" "" "$INSTDIR\run_mldonkey.exe" 0
  CreateShortCut "$SMPROGRAMS\${SHORTNAME}\mldonkey web interface.lnk" "http://127.0.0.1:4080"  0
  CreateShortCut "$SMPROGRAMS\${SHORTNAME}\assign ed2k links to mldonkey.lnk" "$INSTDIR\MLdonkeySubmit.exe" 
  CreateShortCut "$SMPROGRAMS\${SHORTNAME}\mldonkey homepage.lnk" "http://www.nongnu.org/mldonkey"  0
  CreateShortCut "$SMPROGRAMS\${SHORTNAME}\mldonkey forums.lnk" "http://www.mldonkeyworld.com"  0
  CreateShortCut "$SMPROGRAMS\${SHORTNAME}\uninstall.lnk" "$INSTDIR\uninst.exe" "" "$INSTDIR\uninst.exe" 0
SectionEnd


; begin uninstall settings/section
UninstallText "This will uninstall ${SHORTNAME} from your system"

Section Uninstall
; add delete commands to delete whatever files/registry keys/etc you installed here.
Delete "$INSTDIR\uninst.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${SHORTNAME}"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}"
Delete $INSTDIR\*.*
RMDir /r "$INSTDIR"

Delete "$SMPROGRAMS\${SHORTNAME}\*.*"
RMDir "$SMPROGRAMS\${SHORTNAME}"

;Delete "$SMPROGRAMS\${SHORTNAME}\"

SectionEnd ; end of uninstall section

; eof
