(welcome "MoneyManager 1.0 - Installation")

;Directory
(set destdir
  (askdir
    (prompt "Where do you want to install MoneyManager\n A directory will be created")
    (help @askdir-help)
    (default "Work:")
  )
)

(set destdir (tackon destdir "MoneyManager"))

;Installation

(
  (working "Installing " @app-name)

  (copylib
    (prompt "Copying triton.library")
    (help @copylib-help)
    (source "Libs/triton.library")
    (dest "LIBS:")
    (confirm)
  )

  (makedir destdir
    (prompt "Creating the MoneyManager directory")
    (help @makedir-help)
    (infos)
    (confirm)
  )

  (copyfiles
    (prompt "Copying MoneyManager")
    (help @copyfiles-help)
    (source "MoneyManager")
    (dest destdir)
    (infos)
    (confirm)
  )

  (copyfiles
    (prompt "Copying MoneyManager documentation")
    (help @copyfiles-help)
    (source "Documentation")
    (dest (tackon destdir "Documentation"))
    (infos)
    (all)
    (confirm)
  )

  (set #install-locales
    (askoptions
      (prompt "Choose locale catalogs to install")
      (help @askoptions-help)
      (choices "dansk")
    )
  )

  (IF (BITAND #install-locales 1)
    (copyfiles
      (prompt "Copying dansk catalog")
      (help @copyfiles-help)
      (source "Locale/Catalogs/Dansk/MoneyManager.catalog")
      (dest "LOCALE:Catalogs/dansk/")
      (confirm)
    )
  )

  (copyfiles
    (prompt "Copying translation stuff")
    (help @copyfiles-help)
    (source "Locale/MoneyManager.cd")
    (dest destdir)
    (infos)
    (confirm)
  )

  (copyfiles
    (prompt "Copying default data icon")
    (help @copyfiles-help)
    (source "Icons/def_MoneyManager.info")
    (dest "ENVARC:Sys/")
    (confirm)
  )

)

(set @default-dest destdir)
