; This is the ES3000 install script
; $VER: 1.0 (15.01.96) © by Frank Mariak

(transcript "ES3000 installation:")


 (
  (set es_path
    (askdir
      (prompt "Where do you want the \"ES3000\" directory to be created ?")
      (help @askdir-help)
      (default @default-dest)
    )
  )


  (set fpu_avail
   (askbool
    (prompt "\n\n\n\nIs there a 68881/68882 compatible floating point unit (FPU) installed in your system ?")
    (help "By choosing \"Yes\", a special floating point unit version is installed, non fpu version otherwise.")
    (choices "Yes" "No")
    (default 0)
   )
  )

  ; install ES3000

  (if fpu_avail
   (copyfiles
     (prompt "\n\n\nCopying ES3000 program (FPU version)")
     (help @copyfiles-help)
     (source "ES3000:ES3000.FPU")
     (dest (tackon es_path "ES3000"))
     (newname "ES3000")
     (infos)
     (confirm)
   )

   (copyfiles
     (prompt "\n\n\nCopying ES3000 program (FFP version)")
     (help @copyfiles-help)
     (source "ES3000:ES3000")
     (dest (tackon es_path "ES3000"))
     (infos)
     (confirm)
   )
  )


; install example dct files

  (set inst_examples
   (askbool
    (prompt "\n\n\n\nShall the example picture files be installed ?")
    (help "By choosing \"Yes\", a few example pictures are installed, none otherwise.")
    (choices "Yes" "No")
    (default 1)
   )
  )


  (if inst_examples
   (copyfiles
     (prompt "\n\n\nCopying example pictures")
     (help @copyfiles-help)
     (source "ES3000:examples")
     (dest (tackon es_path "ES3000/examples"))
     (all)
     (infos)
     (confirm)
   )
  )


; install gtlayout.library

  (copylib
    (prompt "Copying gtlayout.library") 
    (help @copyfiles-help)
    (source "ES3000:libs/gtlayout.library")
    (dest "libs:")
    (confirm)
  )

;  (if (exists "LOCALE:" (noreq))
;    (
;     ; locale is installed, so copy the catalog stuff
;      (copyfiles
;  	    (prompt "\n\n\nCopying catalog files.")
;        (help @copyfiles-help)
;        (source "ES3000:catalogs/deutsch/ES3000.catalog")
;        (dest "LOCALE:Catalogs/deutsch")
;        (confirm)
;      )
;    )
;  )

  (set old_user (user 1))   ; always ask


  (set maxpens
        (asknumber
          (prompt "\nPlease enter the maximum number of pens which should be allocated for image previews")
          (help "Here you can specify the maximum number of pens which should be used for image previews. If you open on a custom screen, set this to 256, if you open on a pubscreen you should try values between 16-32 to allow other programs allocating pens.")
          (default 256)
        )
  )

  (tooltype
   (prompt "Settings MAXPENS tooltype")
   (help "Modifying the tooltypes of the ES3000 main program to the given values.")
   (dest (tackon es_path "ES3000/ES3000"))
   (settooltype "MAXPENS" (cat maxpens))
   (confirm)
  )

  (set img_format
   (askbool
    (prompt "\n\n\n\nWhich image file format should be used as default save format ?")
    (help "DCT is an internal Chinon ES3000 standard format which has additional picture information within the file, while IFF24 is a widely spreaded image format which can be read by most AMIGA programs but can not be read back by the ES3000 program.")
    (choices "DCT" "IFF24")
    (default 1)
   )
  )

  (if img_format
      (tooltype
        (prompt "Setting default file format to DCT")
        (dest (tackon es_path "ES3000/ES3000"))
        (settooltype "SAVEDCT" "YES")
        (confirm)
      )
      (tooltype
        (prompt "Setting default file format to IFF24")
        (dest (tackon es_path "ES3000/ES3000"))
        (settooltype "SAVEDCT" "NO")
        (confirm)
      )
  )

  (user old_user)

  (exit)
 )
