; Installer-Skript für das ANUBIS Mailbox-System
; ©1993; Olli Graf - T.O.M. Software Wuppertal

(set instpfad
	(askdir
		(prompt "Wohin sollen ANUBIS und seine Verzeichnisse\ninstalliert werden ?")
		(help @askdir-help)
		(default "SYS:")
	)
)

(set docpfad
	(askdir
		(prompt "Pfad für die Guide Files ?")
		(help @askdir-help)
		(default (tackon instpfad "Docs"))
	)
)

(makedir (tackon instpfad "Statistik"))
(makedir (tackon instpfad "Config"))
(makedir (tackon instpfad "Batchs"))
(makedir (tackon instpfad "OnlinePrg")(infos))

(copylib
	(prompt "installiere Hauptprogramm")
	(help @copyfile-help)
	(source "ANUBIS")
	(infos)
	(dest instpfad)
)

(set config
	(askbool
		(prompt "Beispiel-Config installieren ?\nAchtung : Bestehende Daten gehen verloren !")
		(help @askbool-help)
		(choices "Ja" "Nein")
		(default 0)
	)
)

(if (= config 1)
	(copyfiles
		(prompt "kopiere Konfigurationsdaten")
		(help @copyfiles-help)
		(source "Daten")
		(dest	(tackon instpfad "Daten"))
		(pattern "#?")
		(files)
	)

	(copyfiles
		(prompt	"kopiere Textfiles")
		(help @copyfiles-help)
		(source	"Texte")
		(dest	(tackon instpfad "Texte"))
		(pattern "#?")
		(files)
	)
)

(copyfiles
	(prompt	"kopiere hilfstexte")
	(help @copyfiles-help)
	(source	"hilfstexte")
	(dest	(tackon instpfad "hilfstexte"))
	(pattern "#?")
	(files)
)

(copylib
	(prompt "kopiere anubis.library")
	(help @copylib-help)
	(source "libs/anubis.library")
	(dest	"libs:")
	(confirm)
)

(copylib
	(prompt "kopiere anubistools.library")
	(help @copylib-help)
	(source "libs/anubistools.library")
	(dest	"libs:")
	(confirm)
)

(if (exists "libs/req.library")
	(copylib
		(prompt "kopiere req.library")
		(help @copylib-help)
		(source "libs/req.library")
		(dest	"libs:")
		(confirm)
	)
)

(copylib
	(prompt "installiere Anubis-Tools: BrettEd")
	(help @copylib-help)
	(source "AnubisTools/BrettEd")
	(dest	(tackon instpfad "AnubisTools"))
	(infos)
	(confirm)
)

(copylib
	(prompt "installiere Anubis-Tools: UserEd")
	(help @copylib-help)
	(source "AnubisTools/UserEd")
	(dest	(tackon instpfad "AnubisTools"))
	(infos)
	(confirm)
)

(copylib
	(prompt "installiere Anubis-Tools: SystemEd")
	(help @copylib-help)
	(source "AnubisTools/SystemEd")
	(dest	(tackon instpfad "AnubisTools"))
	(infos)
	(confirm)
)

(copylib
	(prompt "installiere Anubis-Tools: CreateFRL")
	(help @copylib-help)
	(source "AnubisTools/CreateFRL")
	(dest	(tackon instpfad "AnubisTools"))
	(confirm)
)

(copyfiles
	(prompt "installiere Anleitungen")
	(help @copyfile-help)
	(source "Docs")
	(dest	docpfad)
	(pattern "#?")
	(infos)
	(files)
)

(copyfiles
	(prompt "installiere Batchs")
	(help @copyfile-help)
	(source "Batchs")
	(dest	(tackon instpfad "Batchs"))
	(pattern "#?")
	(files)
)

(if (exists "Netz.lha")
(
 (set netz
	(askbool
		(prompt "Sollen die Netzmodule installiert werden ?")
		(help @askbool-help)
		(choices "Ja" "Nein")
		(default 1)
	)
 )

 (if (= netz 1)
	(
	 (makedir "Ram:Netzmodule")
	 (run "c:lha x Netz.lha Ram:Netzmodule/"
		(prompt "Netz.lha entpacken ?")
		(help @run-help)
	 	(confirm)
	 )

	 (copyfiles
		(prompt "installiere Anubis-Netz-Tools")
		(help @copyfile-help)
		(source "Ram:Netzmodule/AnubisTools/")
		(dest	(tackon instpfad "AnubisTools"))
		(pattern "#?")
		(infos)
		(confirm)
		(files)
	 )

	 (copyfiles
		(prompt "installiere Netz-Anleitungen")
		(help @copyfile-help)
		(source "ram:Netzmodule/Docs")
		(dest	docpfad)
		(pattern "#?")
		(infos)
		(files)
	 )

	 (copyfiles
		(prompt	"kopiere hilfstexte")
		(help @copyfiles-help)
		(source	"ram:Netzmodule/hilfstexte")
		(dest	(tackon instpfad "hilfstexte"))
		(pattern "#?")
		(files)
	 )

	 (copyfiles
		(prompt "installiere Batchs")
		(help @copyfile-help)
		(source "ram:Netzmodule/Batchs")
		(dest	(tackon instpfad "Batchs"))
		(pattern "#?")
		(files)
	 )

(set config
	(askbool
		(prompt "Netz-Beispiel-Config installieren ?\nAchtung : Bestehenden Daten gehen verloren !")
		(help @askbool-help)
		(choices "Ja" "Nein")
		(default 0)
	)
)

	 (if (= config 1)
		 (copyfiles
			(prompt "installiere Netz-Config-Dateien")
			(help @copyfile-help)
			(source "ram:NetzModule/Config")
			(dest	(tackon instpfad "Config"))
			(all)
		 )

		 (copyfiles
			(prompt "kopiere Konfigurationsdaten")
			(help @copyfiles-help)
			(source "ram:Netzmodule/Daten")
			(dest	(tackon instpfad "Daten"))
			(files)
		 )
	 )
	)
  (delete "ram:Netzmodule")
 )
(startup "Anubis"
	(prompt "ANUBIS Assign in \"s:user-startup\" aufnehmen ?")
	(help @startup-help)
	(command "Assign Anubis: "instpfad"\n")
)

))
