;
; Installer-Script for MEExchange 1.0
; 
;	Autor	: Malte Eller
;	Version	: 1.0
;	Datum	: 15.03.1998
;
;	$VER: Install 1.0 (15.03.1998)
;
;**************************************************

(set @user-level 1)

(if (= @language "deutsch")
(
(set #bad-kick (cat "Leider wird OS3.0 oder höher benötigt"))
(set #askdir1 (cat "Wohin wollen Sie MEExchange installieren?\n"
"Dort wird dann eine neue Schubalde angelegt"))
(set #fragetext (cat "Soll ich das Programm auch in die\n"
" WBStartup kopieren?"))
(set #ja (cat "Ja"))
(set #nein (cat "Nein"))
(set #confirmt (cat "Was soll ich instalieren?"))
(set #fragetextL (cat "Welche Sprachen sollen installiert werden?"))
)

(
(set #bad-kick (cat "I need OS3.0 or higher"))
(set #askdir1 (cat "In which Drawer will you install MEExchange?\n"
"A new Drawer will be create"))
(set #fragetext (cat "Shall I copy the Program to WBStartup"))
(set #ja (cat "Yes"))
(set #nein (cat "No"))
(set #confirmt (cat "What should I install?"))
(set #fragetextL (cat "Which languages should I install?"))
))

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

(if (< (/ (getversion) 65536) 39)
(
    (abort #bad-kick)
))

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

(complete 0)

(set #name
	(askdir
		(prompt #askdir1)
		(help @askdir-help)
		(default "SYS:Tools")
	)
)

(set #Dname (tackon #name "MEExchange"))

(makedir #Dname
 (infos)
)

(copyfiles
	(source "")
	(dest #Dname)
	(pattern "#?")
	(prompt #confirmt)
	(help @confirm-help)
	(confirm)
)

(complete 50)

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

(set name
	(askoptions
		(prompt #fragetext)
		(help @askoptions-help)
		(choices #Ja)
		(default 1)
	)
)

(if (= 1 name)
(
 (copyfiles
	(source "MEExchange")
	(dest "sys:WBStartup")
	(prompt #fragetext)
	(help @confirm-help)
	(confirm)
 )
 (copyfiles
	(source "MEExchange.info")
	(dest "sys:WBStartup")
	(prompt #fragetext)
	(help @confirm-help)
	(confirm)
 )
)
)

(complete 80)

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

(if (exists "sys:locale/catalogs")

 (set #lang (askoptions
		(prompt #fragetextL)
		(help @askoptions-help)
		(choices "Deutsch" "English")
		(default 1))
 )
)

(set #n 0)

(while
	(set #sprache
 		(select #n
 			"Deutsch"
 			"English"
 			""
 		)
 	)
	(
	 (if (IN #lang #n)
		(
		 (set #catalog (tackon "Catalogs" (tackon #sprache "MEExchange.catalog")))
		 (set #destination (tackon "Locale:Catalogs/" #sprache))
		 (copyfiles
			(source #catalog)
			(dest #destination)
			(prompt #confirmt)
			(help @confirm-help)
			(confirm))
		)
	 )
	 (set #n (+ #n 1))
	)
)


(if (getversion "libs:wbstart.library")>2.2
	(
	 (copyfiles
		(source "wbstart.library")
		(dest "libs:")
		(prompt #confirmt)
		(help @confim-help)
		(confirm))
	)
)
(complete 100)
