;mftp INSTALLATION SCRIPT
;COPYRIGHT 1995 MICHAEL NEUWEILER

(complete 0)

;===========================================================================
; English strings

(if (= @language "english")
(
(set locale 0)
(set #bad-MUI 			(cat "You need at least MUI2.3 to use mftp." ))
(set #no-AmiTCP		(cat "\"AmiTCP:\" assign not found.\nmftp needs at least AmiTCP 2.3 to run.\nMake shure AmiTCP is installed properly."))
(set #dir-choice 		(cat "Select the directory where mftp has to be installed." ))
(set #cpu1				(cat "Your Amiga is equipped with a "))
(set #cpu2				(cat " CPU.\nWhich version of mftp would you like to install ?"))
(set #copy 				(cat "Copying mftp"))
(set #doc-choice		(cat "Where do you want to install the documentation?\nIf you want the HELP key to work you should use the given path."))
(set #doc-copy 		(cat "Copying Documentation"))
(set #cat-copy 		(cat "Copying Catalog"))
))

;===========================================================================
; French strings

(if (= @language "franais")
(
(set locale 1)

(set #bad-MUI 		(cat "Vous avez besoin au moins de MUI2.3 pour utiliser mftp." ))
(set #no-AmiTCP	(cat "\"AmiTCP:\" assign not found.\nmftp needs at least AmiTCP 2.3 to run.\nMake shure AmiTCP is installed properly."))
(set #dir-choice 	(cat "Slectionnez le rpertoire dans lequel vous voulez installer mftp." ))
(set #cpu1			(cat "Your Amiga is equipped with a "))
(set #cpu2			(cat " CPU.\nWhich version of mftp would you like to install ?"))
(set #copy	 		(cat "Copie de mftp"))
(set #doc-choice	(cat "Where do you want to install the documentation?\nIf you want the HELP key to work you should use the given path."))
(set #doc-copy		(cat "Copie de la Documentation"))
(set #cat-copy		(cat "Copie de la Catalogue"))
))

;===========================================================================
; German strings

(if (= @language "deutsch")
(
(set locale 2)

(set #bad-MUI 		(cat "Sie bentigen mindestens MUI2.3, um mftp zu nutzen."))
(set #no-AmiTCP	(cat "\"AmiTCP:\" Zuweisung nicht gefunden.\nmftp bentigt mindestens AmiTCP 2.3.\nStellen Sie sicher, dass AmiTCP ordnungsgemss installiert ist"))
(set #dir-choice 	(cat "Whlen Sie das Verzeichnis aus, in welches mftp installiert werden soll."))
(set #cpu1			(cat "Ihr Amiga ist mit einer "))
(set #cpu2			(cat " CPU ausgestattet.\nWelche Version von mftp mchten Sie installieren ?"))
(set #copy 			(cat "Kopiere mftp"))
(set #doc-choice	(cat "Wohin mchten Sie die Dokumentation kopieren ?\nWenn Sie mchten, dass die HELP-Taste funktioniert, sollten Sie das vorgeschlagene Verzeichnis benutzen."))
(set #doc-copy 	(cat "Kopiere Dokumentation"))
(set #cat-copy		(cat "Kopiere Katalog"))
))


;========================================================================
;
; Scanning MUI version
;

(set versionnumber (getversion "LIBS:muimaster.library"))
(set version (/ versionnumber 65536))

(if (< version 8)
	(abort #bad-MUI)
)


;========================================================================
;
; Install the program
;

(set mftp-dir "AmiTCP:")

(if (NOT(exists "AmiTCP:" (noreq)))
	(
		(message #no-AmiTCP)
		(if (= @user-level 0)
			(abort "Couldn't find AmiTCP:")
		)
	)
)

(set mftp-dir
	(askdir
		(prompt #dir-choice)
		(default mftp-dir)
		(help @askdir-help)
	)
)
(set @default-dest mftp-dir)

;
; what cpu have we got
;
(set cpu (+ (database "cpu")))	; (+ ...) makes it an integer value.
(if (> cpu 68020)
	(set turbo 1)
	(set turbo 0)
)
(set turbo
	(askchoice
		(prompt (cat #cpu1 cpu #cpu2))
		(choices "68'000 version" "68'030 version")
		(default turbo)
		(help @askchoice-help)
	)
)

(complete 10)

;
; copy the according version
;
(copyfiles
	(prompt #copy)
	(source (if turbo "/mftp.030" "/mftp"))
	(newname "mftp")
	(help @copyfiles-help)
	(infos)
	(optional force)
	(dest mftp-dir)
)

;========================================================================
;
; Install the documentation
;

(complete 20)
(set doc-dir @default-dest)
(set doc-dir
	(askdir
		(default @default-dest)
		(prompt #doc-choice)
		(help @askdir-help)
	)
)

;
; copy the docs
;
(copyfiles
	(prompt #doc-copy)
	(source (cat "/Docs/mftp_" @language ".guide"))
	(newname "mftp.guide")
	(help @copyfiles-help)
	(infos)
	(optional force)
	(dest doc-dir)
)

;========================================================================
;
; Install catalog files
;
(if locale								; is it necessary to install a catalog ?
	(
		(copyfiles
			(prompt #cat-copy)
			(source (cat "/Catalogs/" @language "/mftp.catalog"))
			(newname "mftp.catalog")
			(help @copyfiles-help)
			(optional force)
			(dest (cat "LOCALE:Catalogs/" @language))
		)
	)
)
