; Script generated by the HM NIS Edit Script Wizard.

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

!define PROGRAM_NAME "FreeDoko"
!define PRODUCT_NAME "FreeDoko"
!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}.Setup.exe"

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


!define SRC_DIR "${PRODUCT_NAME}_${PRODUCT_VERSION}"


!include FreeDoko.common.nsh

Function install_files
  File /r "${SRC_DIR}\*"
FunctionEnd

Function create_icons
  StrCmp $CREATE_DESKTOP_ICON "0" +2
  CreateShortCut "$DESKTOP\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME}.exe" "" "$INSTDIR\${PROGRAM_NAME}.exe"

  StrCmp $ICONS_GROUP "" icon_group_end
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PROGRAM_NAME}.lnk" "$INSTDIR\${PROGRAM_NAME}.exe" "" "$INSTDIR\${PROGRAM_NAME}.exe"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\uninstall.lnk" "$INSTDIR\uninst.exe"
  ; german

  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
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\documentation"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\documentation\manual.lnk" "$INSTDIR\doc\manual\en\overview.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\documentation\introduction.lnk" "$INSTDIR\doc\manual\en\introduction.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\documentation\rules.lnk" "$INSTDIR\doc\manual\en\rules.html"
  goto icon_group_end

icon_group_german: ; german
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\${PROGRAM_NAME} - abgesichert.lnk" "$INSTDIR\${PROGRAM_NAME}.exe" "-" "$INSTDIR\${PROGRAM_NAME}.exe"
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Dokumentation"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Dokumentation\Handbuch.lnk" "$INSTDIR\doc\manual\de\overview.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Dokumentation\Einführung.lnk" "$INSTDIR\doc\manual\de\introduction.html"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Dokumentation\Regeln.lnk" "$INSTDIR\doc\manual\de\rules.html"
  goto icon_group_end

icon_group_end:
FunctionEnd

Function un.remove_files
RMDir /r "$SMPROGRAMS\$ICONS_GROUP\Dokumentation"
RMDir /r "$SMPROGRAMS\$ICONS_GROUP\documentation"
RMDir /r "$SMPROGRAMS\$ICONS_GROUP"
Delete "$DESKTOP\${PROGRAM_NAME}.lnk"
Delete "$INSTDIR\COPYING"
!include "FreeDoko.Files.uninstall.nsi"
Delete "$INSTDIR\ChangeLog"
FunctionEnd
