; Script generated by the HM NIS Edit Script Wizard.

;--------------------------------
;General

!define PROGRAM_NAME "FreeDoko"
!define PRODUCT_NAME "FreeDoko-dev"
!define PRODUCT_VERSION "$%VERSION%"
!define PRODUCT_AUTHORS "Borg Enders und Diether Knof"
!define PRODUCT_PUBLISHER "${PRODUCT_AUTHORS}"
!define PRODUCT_WEB_SITE "http://free-doko.sourceforge.net/"

;Name and file
Name "${PROGRAM_NAME} ${PRODUCT_VERSION}"
OutFile "${PROGRAM_NAME}_${PRODUCT_VERSION}-dev.Setup.exe"

;Default installation folder
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"


!define SRC_DIR "install_dev.release"

!define INSTALLED_FILES_TEXT "  \
  $INSTDIR\\trunk\\\r\n  \
  $INSTDIR\\manual\\\r\n  \
  $INSTDIR\\install_dev\\\r\n  \
  $INSTDIR\\download\\\r\n  \
  $INSTDIR\\bin\\\r\n  \
  $INSTDIR\\LiesMich\r\n  \
  $INSTDIR\\Dateien\r\n  \
  $INSTDIR\\GPL\r\n  \
  $INSTDIR\\LGPL\r\n  \
  $INSTDIR\\ReadMe.wget\r\n  \
  $INSTDIR\\ReadMe.7z\r\n  \
  $INSTDIR\\md5sum.html\r\n  \
  $INSTDIR\\install.bat\r\n  \
  $INSTDIR\\update.bat\r\n  \
  $INSTDIR\\uninst.exe\r\n  \
  $INSTDIR\\uninst.exe\r\n  \
  $SMPROGRAMS\\$ICONS_GROUP\r\n  \
  $DESKTOP\\${PROGRAM_NAME}.lnk"

!include FreeDoko.common.nsh

Function install_files
  File "${SRC_DIR}\LiesMich"
  File "${SRC_DIR}\Dateien"
  File "${SRC_DIR}\ReadMe.7z"
  File "${SRC_DIR}\ReadMe.wget"
  File "${SRC_DIR}\md5sum.html"
  File "${SRC_DIR}\GPL"
  File "${SRC_DIR}\LGPL"
  File "${SRC_DIR}\install.bat"
  File "${SRC_DIR}\update.bat"
  File /r "${SRC_DIR}\bin"

  ExecWait "$INSTDIR\install.bat"
FunctionEnd

Function create_icons
  StrCmp $CREATE_DESKTOP_ICON "0" +4
  SetOutPath $INSTDIR\trunk\src
  CreateShortCut "$DESKTOP\${PROGRAM_NAME}.lnk" "$INSTDIR\trunk\src\${PROGRAM_NAME}.bat" "" "$INSTDIR\trunk\src\${PROGRAM_NAME}.ico" "" SW_SHOWNORMAL "" "Ein freies Doppelkopf Spiel"
  SetOutPath $INSTDIR

  StrCmp $ICONS_GROUP "" icon_group_end
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
  SetOutPath $INSTDIR\trunk\src
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PROGRAM_NAME}.lnk" "$INSTDIR\trunk\src\${PROGRAM_NAME}.bat" "" "$INSTDIR\trunk\src\${PROGRAM_NAME}.ico" "" SW_SHOWNORMAL "" "Ein freies Doppelkopf Spiel"
  SetOutPath $INSTDIR
 

  StrCmp $LANGUAGE ${LANG_ENGLISH} icon_group_english
  StrCmp $LANGUAGE ${LANG_GERMAN}  icon_group_german
  StrCmp $LANGUAGE ${LANG_FRENCH}  icon_group_french
  goto icon_group_english

icon_group_english: ; english
icon_group_french: ; french
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\update.lnk" "$INSTDIR\update.bat"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\uninstall.lnk" "$INSTDIR\uninst.exe"
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\documentation"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\documentation\manual.lnk" "$INSTDIR\manual\en\overview.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\documentation\introduction.lnk" "$INSTDIR\trunk\doc\manual\en\introduction.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\documentation\rules.lnk" "$INSTDIR\manual\en\rules.html"
  goto icon_group_end

icon_group_german: ; german
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\aktualisieren.lnk" "$INSTDIR\update.bat"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\deinstallieren.lnk" "$INSTDIR\uninst.exe"
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Dokumentation"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Dokumentation\Handbuch.lnk" "$INSTDIR\manual\de\overview.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Dokumentation\Einführung.lnk" "$INSTDIR\manual\de\introduction.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Dokumentation\Regeln.lnk" "$INSTDIR\trunk\doc\manual\de\rules.html"
  goto icon_group_end

icon_group_end:
FunctionEnd

Function un.remove_files
  RMDir /r "$INSTDIR\trunk"
  RMDir /r "$INSTDIR\manual"
  RMDir /r "$INSTDIR\install_dev"
  RMDir /r "$INSTDIR\download"
  RMDir /r "$INSTDIR\bin"
  Delete "$INSTDIR\LiesMich"
  Delete "$INSTDIR\Dateien"
  Delete "$INSTDIR\GPL"
  Delete "$INSTDIR\LGPL"
  Delete "$INSTDIR\ReadMe.wget"
  Delete "$INSTDIR\ReadMe.7z"
  Delete "$INSTDIR\md5sum.html"
  Delete "$INSTDIR\install.bat"
  Delete "$INSTDIR\update.bat"
  Delete "$INSTDIR\uninst.exe"
FunctionEnd
