;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"))
(set #doc-file			(cat "mftp_English.guide"))
))

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

(if (= @language "français")
(
(set locale 1)

(set #bad-MUI 		(cat "Vous avez besoin d'au moins MUI3.1 pour utiliser mftp." ))
(set #no-AmiTCP	(cat "\"AmiTCP:\" assign non trouvé.\nmftp a besoin d'au moins AmiTCP 2.3 pour fonctionner.\nAssurez vous qu'AmiTCP est correctement installé."))
(set #dir-choice 	(cat "Sélectionnez le répertoire dans lequel vous voulez installer mftp." ))
(set #cpu1			(cat "Votre Amiga est équipé d'un "))
(set #cpu2			(cat " CPU.\nQuelle version de mftp désirez-vous installer ?"))
(set #copy	 		(cat "Copie de mftp"))
(set #doc-choice	(cat "Où voulez-vous installer la documentation?\nSi vous voulez que la touche HELP fonctionne vous devez donner le chemin d'accès\n au fichier guide."))
(set #doc-copy		(cat "Copie de la Documentation"))
(set #cat-copy		(cat "Copie du Catalogue"))
(set #doc-file		(cat "mftp_English.guide"))
))

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

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

(set #bad-MUI 		(cat "Sie benötigen mindestens MUI2.3, um mftp zu nutzen."))
(set #no-AmiTCP	(cat "\"AmiTCP:\" Zuweisung nicht gefunden.\nmftp benötigt mindestens AmiTCP 2.3.\nStellen Sie sicher, dass AmiTCP ordnungsgemäss installiert ist"))
(set #dir-choice 	(cat "Wählen 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 möchten Sie installieren ?"))
(set #copy 			(cat "Kopiere mftp"))
(set #doc-choice	(cat "Wohin möchten Sie die Dokumentation kopieren ?\nWenn Sie möchten, dass die HELP-Taste funktioniert, sollten Sie das vorgeschlagene Verzeichnis benutzen."))
(set #doc-copy 	(cat "Kopiere Dokumentation"))
(set #cat-copy		(cat "Kopiere Katalog"))
(set #doc-file		(cat "mftp_Deutsch.guide"))
))

; =========================================================================
; Italian strings

(if (= @language "italiano")
(
(set locale 3)
(set #bad-MUI		(cat "Per usare mftp è necessaria MUI2.3 o superiore." ))
(set #no-AmiTCP	(cat Assign "\"AmiTCP:\" non trovato.\nmftp necessita almeno di AmiTCP 2.3 per funzionare.\nAccertati che AmiTCP sia correttamente installato."))
(set #dir-choice	(cat "Seleziona la directory in cui installare mftp." ))
(set #cpu1			(cat "Il tuo Amiga è dotato di "))
(set #cpu2			(cat " CPU.\nQuale versione di mftp vuoi installare ?"))
(set #copy			(cat "Copio mftp"))
(set #doc-choice	(cat "Dove vuoi che sia installata la documentazione?\nPerchè il tasto HELP funzioni correttamente devi scegliere il path preimpostato."))
(set #doc-copy		(cat "Copio la documentazione"))
(set #cat-copy		(cat "Copio i Catalog"))
(set #doc-file		(cat "mftp_English.guide"))
))

;===========================================================================
; Nederlands strings

(if (= @language "nederlands")
(
(set locale 4)
(set #bad-MUI		(cat "Uw heeft op zijn minst MUI MUI2.3 nodig om mftp te draaien." ))
(set #no-AmiTCP	(cat "\"AmiTCP:\" assign niet gevonden.\nmftp heeft op zijn minst AmiTCP 2.3 nodig.\nWees er zeker van dat AmiTCP is goed geïnstalleerd."))
(set #dir-choice	(cat "Selekteer de lade waar mftp in moet worden geïnstalleerd." ))
(set #cpu1			(cat "Uw Amiga is voorzien van een"))
(set #cpu2			(cat " CPU.\nWelke versie van mftp zou U willen installeren ?"))
(set #copy			(cat "Kopiëren mftp"))
(set #doc-choice	(cat "Waar wilt u de documenten installeren ?\nAls u wilt dat de HELP toets werkt moet u de gegeven lade kiezen."))
(set #doc-copy		(cat "Kopiëren Documentatie"))
(set #cat-copy		(cat "Kopiëren Catalog"))
(set #doc-file		(cat "mftp_Nederlands.guide"))
))



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

(if (NOT(exists "LIBS:muimaster.library"))
	(abort (cat #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/" #doc-file))
	(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))
		)
	)
)
