;
;	Installscript for
; @1996 Bodo Hoffmann
;
;	"VER: INSTALL_DRETOP v1.0 (15-Sep-96)
;

(if (= @language "deutsch")
	(
		(set	#welcome						(cat	"\nWillkommen zur Installation von\n"
																		"dRE!tOP v1.o (CLI) for FAME BBS\n"
																		"Dieses Script installiert dRE!tOP\n"
																		"auf ihrem AMIGA, so das Sie das DOOR\n"
																		"direkt in Benutzung nehmen knnenn\n"
																		"Dieses Program ist REGISTERWARE\n"
																		"Um eine volle Version zu bekommen sollten\n"
																		"Sie sich bei mir registrieren lassen, bitte\n"
																		"lesen Sie in dem Amigaguide Document wo und\n"
																		"wie Sie dieses tuen knnen\n"
																		"Dis ist eine unregistrierte Version mit Ein-\n"
																		"schrnkungen in der Konfiguration"
															)
		)

		(set	#instdir-prompt			(cat	"Bitte whlen sie jetzt das Verzeichnis in dem dRE!WhO installiert werden soll, eine Schublade wird erzeugt"))

		(set	#askguide-prompt		(cat	"\n\n\n\n\nMchten Sie das Amigaguide Dokument fr dRE!tOP installieren ?"))
	
		(set	#guidedir-prompt		(cat	"Bitte whlen Sie das Zielverzeichnis fr das Dokument, ein Verzeichnis wird erstellt."))

		(set	#askconfig-prompt		(cat	"\n\n\n\nMchten Sie die beigefgten Konfigurationen installieren?\n(Wird dringenst empfohlen)"))

		(set	#config-prompt			(cat	"Bitte whlen Sie die Konfiguartion die Sie installieren mchten"))

		(set	#inst-button				(cat	"Installieren"))

		(set	#skip-button				(cat	"berspringen"))

		(set	#drelib-prompt			(cat	"Installiere DRE.library"))

		(set	#finish-msg					(cat	"\nDie Installation ist nun abgeschlossen.\n"
																		"Bitte lesen Sie nun das Amigaguide dokument\n"
																		"unter Usage wie Sie dRE!tOP in Ihre BBS ein-\n"
																		"binden.\n\n"
																		"Ebenso lesen Sie bitte unter Config-files wie\n"
																		"Sie die Bulletins an Ihre BBS anpassen.\n"
																		"Es ist absolut notwendig das Sie diese Teile\n"
																		"in der Anleiting lesen, andernfalls kann es zu\n"
																		"Konfiguratons Problemen kommen\n\n"
																		"BITTE LASSEN SIE SICH REGISTRIEREN UM EINE\n"
																		"VOLL VERSION ZU BEKOMMEN\n"
															)
		)
	)
)

(if	(=	@language "english")
	(
		(set	#welcome						(cat	"\nWelcome to the Installation of\n"
																		"dRE!tOP v1.o (CLI)\n"
																		"This program will install dRE!tOP\n"
																		"on your AMIGA, so it is ready to use after\n"
																		"this procedure\n\n\n"
																		"This program is REGISTERWARE\n"
																		"To become a full version you should register\n"
																		"my programs, please refer to the AmigaGuide\n"
																		"Document for more informations how and where\n"
																		"you can do this...\n"
																		"This is a public version with limits in the\n"
																		"configuration."
															)
		)

		(set	#instdir-prompt			(cat	"Please select the drawer where dRE!WhO should be installed, a drawer will be created"))

		(set	#askguide-prompt		(cat	"\n\n\n\n\nDo you like to install the Amigaguide style document ?"))
	
		(set	#guidedir-prompt		(cat	"Please select the directory to copy the document to..."))

		(set	#askconfig-prompt		(cat	"\n\n\n\nDo you like to install the supplied example configfiles ?\n(I would prefer to it)"))

		(set	#config-prompt			(cat	"Please select now the configfiles to install"))

		(set	#inst-button				(cat	"Install"))

		(set	#skip-button				(cat	"Skip this Part"))

		(set	#drelib-prompt			(cat	"Installing	DRE.library"))

		(set	#finish-msg					(cat	"\n\nThe install is now done...\n"
																		"Please read now in documentation under usage\n"
																		"how to run dRE!tOP for your BBS.\n"
																		"Also read the point config-files which describes\n"
																		"how to configure the config-files for your BBS.\n"
																		"\nIt`s absolut necessary to read the parts of the\n"
																		"document, otherwise it can come to big problems\n"
																		"when running dRE!tOP.\n"
																		"\n!!! PLEASE REGISTER TO BECOME A FULL VERSION !!!"
															)
		)
	)
)

	(complete 0)

	(message	#welcome)

	(set instdir	(askdir	(prompt	#instdir-prompt)
												(help	@askdir-help)
												(default	"FAME:MODULES/UTILS")
								)
	)

	(complete 10)

	(makedir instdir	(infos))

	(complete 20)

	(copyfiles	(prompt		"dRE!tOP...")
							(source		"/FILES/Dre!top")
							(dest			instdir)
							(optional nofail askuser)
							(confirm)
	)


	(complete 30)

	(if (askbool	(prompt #askguide-prompt)
								(choices #inst-button	#skip-button)
								(default	0)
								(help	@askbool-help)
			)
			(
				(set	guidedir	(askdir	(prompt	#guidedir-prompt)
																(help	@askdir-help)
																(default	instdir)
												)
				)

				(makedir guidedir	(infos))

				(copyfiles	(prompt	"Amigaguide Document")
										(source	"/Guides")
										(dest		guidedir)
										(all)
										(optional nofail askuser)
										(confirm)
				)
			)
	)

	(complete 40)

	(if (askbool	(prompt #askconfig-prompt)
								(choices #inst-button	#skip-button)
								(default	0)
								(help	@askbool-help)
			)
			(
				(set configs	(	askoptions	(prompt #config-prompt)
																		(help	@askoptions-help)
																		(choices
																			"Top Uploader"
																			"Top Downloader"
																			"Top Caller"
																			"Top MSG write/read"
																			"Top CPS rates"
																			"Top Pager"
																			"BBS Status"
																			"Userlist"
																		)
																		(default -1)
											)
				)
			(if	(OR (> configs	0))
				(	(set	mincfg	0)
					(set	maxcfg	10)
					(while	(< mincfg	maxcfg)
						(
							(if (IN	configs	mincfg)
								(
									(set	copycfg
										(select	mincfg
											"TOPUL.cfg"
											"TOPDL.cfg"
											"TOPCALL.cfg"
											"TOPMSG.cfg"
											"TOPCPS.cfg"
											"TOPPAGE.cfg"
											"BBSSTATS.cfg"
											"USERLIST.cfg"
										)
									)

									(copyfiles
										(prompt ("/configs/%s" copycfg))
										(source	("/configs/%s" copycfg))
										(dest	instdir)
										(optional nofail askuser)
										(confirm)
									)
								)
							)
						(set mincfg (+ mincfg 1))
						)
					)
				)
			)
		)
	)

	(complete 50)

	(copyfiles
        (prompt #drelib-prompt)
        (source "/Libs/DRE.library")
        (dest   "LIBS:")
				(optional nofail askuser)
        (help @copyfiles-help)
	)

	(message	#finish-msg)
	(run	"Sys:Utilities/AmigaGuide /Guides/dRE!tOP.guide")
	(complete 100)
