; $VER: TD Prefs 2 Install 1.0 (3.9.97)
; Installs TD Prefs 2

;text

(set #t_hello "\nWelcome to the TD Prefs 2 Installation\nVersion 1.0\nŠ1997 Steven Pearson\n")
(set #t_notrit "Installation Failed\n\nPlease Install The Version of Triton Included, Reset and Try Again")
(set #t_tdwhereprompt "Where Should the Executable TD_Prefs2 be copied to.\nA directory will NOT be created\n")
(set #t_tdwherehelp "TD Prefs is a Prefs Editor and should be kept with your other Prefs Editors.\nThis is usually in SYS:Prefs")
(set #t_docwhereprompt "Where Should the Documentation be copied.\nA Directory called TDPrefs2 Will be created\n")
(set #t_docwherehelp "The Documentation is in HTML format.\n It will be installed into it's own directory to enable Un-Installation easily\nTo read the documentation use a HTML Reader or Web Browser such as\n\nMoreHTML - A Minimal NON Internet HTML reader, Needs MUI\nVoyager - A Fully Functioning ShareWare Web Browser, Needs MUI\nAweb - Another Shareware?Browser, Does NOT need MUI\nIBrowse - Commercial Web Browser From HiSoft")

;variables

(set #v_tdsource (pathonly @icon))
(set #v_tddest "Sys:Prefs")
(set #v_docdrawer "TdPrefs2")
(set #v_docdest "Help:")

(complete 0)

(welcome #t_hello)
(if ( < (/ (getversion "libs:triton.library") 65536) 6 )
    (exit #t_notrit (quiet))
)

(complete 17)

(set #v_tddest (askdir
    (prompt #t_tdwhereprompt)
    (help #t_tdwherehelp)
    (default #v_tddest)
))
(set @default-dest #v_tddest)

(complete 33)


(set #v_docdest (askdir
    (prompt #t_docwhereprompt)
    (help #t_docwherehelp)
    (default #v_docdest)
))

(set #v_docdest (tackon #v_docdest #v_docdrawer) )

(complete 50)


(if (not (exists #v_docdest))
	(
		(makedir #v_docdest )
	)
)

(complete 67)


;copy files

(copyfiles
    (infos)
    (source (tackon #v_tdsource "TD_Prefs2") )
    (dest #v_tddest)
)

(complete 83)

(copyfiles
    (source (tackon #v_tdsource "Docs") )
    (dest #v_docdest)
    (all)
)

(complete 100)
(exit)
