; Installer Script for SimpleFTP (AmigaOS 3.5)
; $VER: Install v1.1 (15.01.00)

(effect "lower_left" "radial" $000000 $0000FF)
(set #logo "Install-Logo.gif")
(set #register "Install-Register.gif")
(set #thanks "Install-Thanks.gif")

(set #install-docs
(cat "Install documentation?\n"
))

(set #select-lang
(cat "Select language:"
))

(set #not-installed
(cat "\nSimpleFTP has NOT been installed.\n"
))

(set #goodbye
(cat "\nInstallation of SimpleFTP is complete.\n\n"
     "If you have used a version previous to v1.83,\n"
     "but after v1.80, it is important that you run\n"
     "the SiteConverter tool to update your saved\n"
     "list of favourite FTP sites.\n"
     "(Copy it to your SimpleFTP directory first)"
))

(set #select-dir
(cat "Please select somewhere to install SimpleFTP\n"
     "(A directory is NOT created for you)"
))

(set #my-address
(cat "\nContact Information\n\n"
     "Author: Rick Hodger\n"
     "e-Mail: rick@thehub.u-net.com\n"
     "Bugs: bugs@thehub.u-net.com\n"
     "Web: http://www.thehub.u-net.com\n"
))

(set #copyright
(cat "\nSimpleFTP is (C) Copyright 1998-1999 Rick Hodger\n"
     "Written by Rick Hodger\n\n"
     "The author in no way offers any guarantees or warranties "
     "with this program.  By continuing this installation, "
     "you agree that the author is in no way responsable "
     "for any damage caused.\n\n"
     "Do you agree to these terms?"
))

;**************************************************************************************************

(showmedia 'logo' #logo 'upper_right' 'none' 1)

(complete 5)
(set agree (askbool (prompt #copyright)
      (help #install-docs-help)
      (choices "Yes" "No")
     )
)

(if (= agree 0)       (
  (message #not-installed)
  (exit (quiet))
))

;******************************************** Locale Stuff *****************************************

(complete 10)
  (set catalog
    (askchoice
      (choices "English (Built-in)" "Deutsch" "Español" "Français" "Greek" "Italiano" "Norsk" "Português" "Svenska")
       (prompt #select-lang)
      (help   "None here")
    )
  )
  (set loc-target "LOCALE:Catalogs/")
  (set loc-source "locale/")

  (if (= catalog 1)     (
    (set loc-target (tackon loc-target "Deutsch"))
    (set loc-source (tackon loc-source "Deutsch"))
    (set loc-use 1)
  ))
   
  (if (= catalog 2)     (
    (set loc-target (tackon loc-target "Español"))
    (set loc-source (tackon loc-source "Español"))
    (set loc-use 1)
  ))

  (if (= catalog 3)     (
    (set loc-target (tackon loc-target "Français"))
    (set loc-source (tackon loc-source "Français"))
    (set loc-use 1)
  ))

  (if (= catalog 4)     (
    (set loc-target (tackon loc-target "Greek"))
    (set loc-source (tackon loc-source "Greek"))
    (set loc-use 1)
  ))

  (if (= catalog 5)     (
    (set loc-target (tackon loc-target "Italiano"))
    (set loc-source (tackon loc-source "Italiano"))
    (set loc-use 1)
  ))

  (if (= catalog 6)     (
    (set loc-target (tackon loc-target "Norsk"))
    (set loc-source (tackon loc-source "Norsk"))
    (set loc-use 1)
  ))

  (if (= catalog 7)     (
    (set loc-target (tackon loc-target "Português"))
    (set loc-source (tackon loc-source "Português"))
    (set loc-use 1)
  ))

  (if (= catalog 8)     (
    (set loc-target (tackon loc-target "Svenska"))
    (set loc-source (tackon loc-source "Svenska"))
    (set loc-use 1)
  ))

(if (= loc-use 1)    (
  (set loc-source (tackon loc-source "SimpleFTP.catalog"))
;  (if (< (exists (loc-target)) 2) makedir loc-target) )
  (copyfiles (
    (source loc-source)
    (dest   loc-target)
  ))
))

;*************************************** Select destination ****************************************

(complete 20)
(set target1         (askdir
   (help   "No help here matey!")
   (prompt #select-dir)
   (default "Miami:")
))

(set target2 target1)

(complete 25)
(complete 50)
(copyfiles (
   (prompt "Select files you want installed")
   (help   "Umm....duh?")
   (source  "")
   (dest    target1)
   (choices "SimpleFTP" "SimpleFTP.info" "SimpleFTP.sites" "Icons")
   (CONFIRM)
))

(closemedia logo)
(showmedia 'register' #register 'upper_right' 'none' 1)

;(complete 60)
;(copyfiles (
;  (prompt "Select extra icons you want installed")
;  (help   "Yargh"
;  (source "icons")
;  (dest   target2)
;  (choices "upload.info")
;  (CONFIRM)
;))

(complete 75)
(set docs (askbool (prompt #install-docs)
      (help #install-docs-help)
      (choices "Yes" "No")
     )
)

(complete 85)
(if (= docs 1)          (
   (set target3         (askdir
      (prompt "Select Directory for SimpleFTP.html")
      (help "Directory where SimpleFTP.html will be copied to.")
      (default target1)
   ))
   (copyfiles (
      (prompt  "Select files you wish Installed")
      (help "Documentation.")
      (source  "")
      (dest    target3)
      (choices "SimpleFTP.html" "SimpleFTP.html.info" "README.TXT")
      (CONFIRM)
   ))
))

(closemedia register)
(showmedia 'thanks' #thanks 'upper_right' 'none' 1)
(complete 100)
(message #goodbye)
(message #my-address)

(exit (quiet))
