;
; $PROJECT: HTDS Update V40.4
;
; $VER: Install 40.1 (10.09.96)
;
; by
;
; Stefan Ruppert , Windthorststrasse 5 , 65439 Floersheim , GERMANY
;
; (C) Copyright 1996
; All Rights Reserved !
;
; $HISTORY:
;
; 10.09.96 : 040.001 : initial
; 07.02.96 : 041.001 : initial
;

;
; customization section
;

(set #basename      "directory")
(set #datatype      (cat #basename ".datatype"))

; datatype exists for the specified cpu's
(procedure #suffix
    (if (= 0 #proc) (".000")
    (if (= 1 #proc) (".020")
    (if (= 2 #proc) (".030")
    (if (= 3 #proc) (".040")
    ))))
)

(set #current-proc 0)
(procedure #current-proc
    ; current cpu
    (set cpu (database "cpu"))
    (if (= cpu "68000") ("0")
    (if (= cpu "68020") ("1")
    (if (= cpu "68030") ("2")
    (if (= cpu "68040") ("3")
    ))))
)

(set #proc (#current-proc))
(set #proc-num (+ 0 #proc))

; get classes dir
(set #classdir
	(askdir
		(prompt "Where do the Classes belong")
		(help @askdir-help)
		(default "SYS:Classes")
	)
)

(working "Installing " @app-name)

; choose cpu type
(set #proc
    (askchoice
	(prompt (cat "There are different versions of \"" #datatype "\", each one optimized "
		     "for a specific CPU type. Please select one: "))
	(choices "MC68000" "MC68020" "MC68030" "MC68040")
	(help (cat "  Select here the CPU type that is installed in your system. "
	      "\n\n  Currently, this is a MC" cpu ".\n\n  If you select a certain CPU type "
	      "in the choice box, the \"" #datatype "\" will run on any CPU which "
	      "type is higher or equal to the selection. However, it won't "
	      "run on a system equipped with a lower type.\n\n"
	      @askchoice-help)
	)
	(default #proc-num)
    )
)

; Install the classes
(copylib
    (prompt (cat "Copying " #datatype))
    (help @copylib-help)
    (source (cat (tackon "classes/datatypes" #datatype) (#suffix)))
    (dest (tackon #classdir "DataTypes"))
    (newname #datatype)
    (confirm)
)

; get classes dir
(set #htds-programmer
	(askdir
		(prompt "Where are the HTDS SDK files ?")
		(help @askdir-help)
		(default "Work:")
	)
)


; install include file
(if (= (exists (tackon #htds-programmer "programmer") (noreq)) 2)
    (set #htds-programmer (tackon #htds-programmer "programmer"))
)


(copyfiles
	(prompt "Copying template source files")
	(help @copyfiles-help)
	(source "programmer/source/template")
	(dest (tackon #htds-programmer "source/template"))
	(pattern "#?")
	(confirm)
)

(exit)

