;Install-Script for CD-Server by SieGeL (tRSi/X-iNNOVATiON)

(COMPLETE 0)
(WELCOME "Welcome to the CD-Server V1.00 Installationscript.")
(MESSAGE "This script will install CD-Server and all needed files to your System.\n\n(NOTE:This Program is only useful for BBS-Systems!)\n\nIf you want to install it now select Proceed\n\nor Press Abort to exit !")
(SET @app-name "CD-Server V1.00")
(SET @error-msg "WARNING: CD-Server-Installation is stopped!")
(SET @default-dest "DOORS:")
(SET commanddir "BBS:COMMANDS/BBSCMD/")
(SET helpdir "S:")

;-------------------------- HILFS-TEXTE  -----------------------------------

(SET #devhelp
 (cat		"Here you have to enter a DEVICE which should be used\n"
                "whith CD-Server. Please do yourself a favour and don't\n"
                "enter here any Assigns, 'coz this is unsafety !\n\n"
                "For more Informations take a look in the Manual !\n\n"
                @askstring-help))

(SET #CONVERT-HELP
 (cat		"To allow users to view Amiga-Guide Databases as ANSI-\n"
                "Files, CD-Server uses an external Converter-Program.\n"
                "If you decides to install it, the Converter will be\n"
                "copied to your C: dir under the Name 'GUIDE2DOCPROF'.\n\n"
                @ASKBOOL-HELP))

(SET #PACKDIR-HELP
 (CAT           "The Temp-Dir is only used to covert the Guides to\n"
                "this Directory, so you should have at least 1 MB free\n"
                "Space on this Device, 'coz AmigaGuides could easily\n"
                "grow in their size over 1MB, and therefor you should\n"
                " have enough Bytes free.\n\n"
                @ASKSTRING-HELP))

(SET #ASSIGN-HELP
 (CAT           "The assign 'SERVER:' is needed to let the BBS comunicate\n"
                "with CD-Server. You have to add the SERVER: assign as DL-\n"
                "Path to every Conference you want to let CD-Server working!\n\n"
                @ASKBOOL-HELP))

;-------------- ERSTMAL ABCHECKEN, WELCHE BBS LÄUFT ------------------------

(COMPLETE 10)

(SET BBSSYSTEM
 (ASKCHOICE 	(PROMPT "Please choose the BBS-System you are running:")
        	(HELP @ASKCHOICE-HELP)
            	(CHOICES "FAME"
                	 "AMIEX")
            	(DEFAULT 1)))

;---------------- DANN ERSTMAL DAS DOOR INSTALLEN --------------------------

(COMPLETE 20)

  (SET maindest
   (ASKDIR (PROMPT "Please select Destination for CD-Server V1.00:")
           (HELP @ASKDIR-HELP)
	   (DEFAULT @default-dest)))

  (SET @default-dest maindest)
  (COPYFILES (PROMPT "NOW COPYING FILE...")
	     (HELP @COPY-HELP)
	     (SOURCE "BBS/DOORS/CD-SERVER/CD-SERVER")
	     (DEST @default-dest)
	     (INFOS))

;------------- NUN FUELLEN WA ERSTMAL DAS ICON AUS -------------------------

(COMPLETE 30)

 (SET devname
  (ASKSTRING (PROMPT "\nNow please enter the Device,\n\nwhich should be used with CD-Server\n\n(NO ASSIGNS ALLOWED, ONLY DEVICES!)\n")
             (HELP #devhelp)
             (DEFAULT "CD0:")))

(COMPLETE 40)

 (SET JANEIN
  (ASKBOOL (PROMPT "\nCD-Server uses an external AmigaGuide->ANSI Converter\n\nfor viewing Guides, do you want to install it ?\n\n")
           (HELP #CONVERT-HELP)
           (DEFAULT 1)
           (CHOICES "Yes, I like this"
                    "Oh no, I hate this")))

 (IF (= JANEIN 1)
  (
   (COPYFILES (PROMPT "Copying Guide2Doc-Converter to C: ...")
              (SOURCE "C/GUIDE2DOCPROF")
              (DEST   "C:"))

   (COMPLETE 41)

   (SET JANEIN
    (ASKBOOL (PROMPT "\nCD-Server uses the T: dir as default\n\nfor converting the Guides.\n\nIs this okay for you ?")
             (HELP #PACKDIR-HELP)
             (DEFAULT 1)
             (CHOICES "Yes, I love it"
                      "No, I change it")))

   (COMPLETE 45)

   (if (= JANEIN 0)
    (SET alternatedir
     (ASKDIR    (PROMPT "\nSelect new Temp-Dir for CD-Server\n\nThere should be at least 1MB free Space\n")
                (HELP @ASKDIR-HELP)
                (DEFAULT "RAM:"))))
))

(TOOLTYPE (DEST (tackon @default-dest "CD-Server"))
   (SETTOOLTYPE "DEVICE" devname)
   (if (= JANEIN 0) (SETTOOLTYPE "PACKDIR" alternatedir))
   (NOPOSITION))

;----------------- NU DIE ONLINE-HILFE HINTERHER ---------------------------

(COMPLETE 50)

(SET JANEIN
 (ASKBOOL (PROMPT "Do you want to copy the Online-Help to your S: Dir\n\nto have an overview of all commands accessable ?\n\n(Highly recommended)")
          (HELP @ASKBOOL-HELP)
          (DEFAULT 1)
          (CHOICES "Yep, I want it"
                   "Nope, I hate it")))

(IF (= JANEIN 1) (COPYFILES (PROMPT "Copying Online-Help to S: ...")
                            (SOURCE "S/CD-SERVER.HLP")
                            (DEST "S:")))

;----------------- JETZT DIE DOC-FILES + HISTORY ---------------------------

(COMPLETE 60)

(SET docdest
 (ASKDIR (PROMPT "\nPlease select Destination for the Documentation:")
	 (HELP @ASKDIR-HELP)
	 (DEFAULT @default-dest)))

(SET sprachen
 (ASKOPTIONS (PROMPT "Please choose which parts of the Documentation\n\nshould be installed:")
	     (HELP @ASKOPTIONS-HELP)
	     (CHOICES "Deutsch"
		      "English"
		      "History")
	     (DEFAULT 5)))

(IF (IN sprachen 0)
	(COPYFILES (PROMPT "NOW COPYING FILE...")
		   (HELP @COPY-HELP)
		   (SOURCE "BBS/DOORS/CD-SERVER/CD-SERVER_dEUTSCH.GUIDE")
		   (DEST docdest)
		   (INFOS)))

(IF (IN sprachen 1)
	(COPYFILES (PROMPT "NOW COPYING FILE...")
		   (HELP @COPY-HELP)
		   (SOURCE "BBS/DOORS/CD-SERVER/CD-SERVER_eNGLISH.GUIDE")
		   (DEST docdest)
		   (INFOS)))

(IF (IN sprachen 2)
	(COPYFILES (PROMPT "NOW COPYING FILE...")
		   (HELP @COPY-HELP)
		   (SOURCE "BBS/DOORS/CD-SERVER/CD-Server.history")
		   (DEST docdest)
		   (INFOS)))

;------- JETZT MUSS DAS ASSIGN SERVER: KLAR GEMACHT WERDEN ----------------

(COMPLETE 70)

 (STARTUP "CD-Server"
          (PROMPT "Now adding the following line to your user-startup :\n\n\"ASSIGN >NIL: SERVER: T: DEFER\"\n\n")
          (HELP @STARTUP)
          (COMMAND "ASSIGN >NIL: SERVER: T: DEFER"))

;------------- NU KOMMEN DIE BBS-SPEZIFISCHEN DINGE -----------------------
;
;-------------------- AMIEX-ICON INSTALLIEREN -----------------------------

(IF (= BBSSYSTEM 1)
 (
  (COMPLETE 80)
  (SET comdir
   (ASKDIR (PROMPT "Please select destination for CD-Server's /X icon:")
	   (HELP @ASKDIR-HELP)
	   (DEFAULT commanddir)))
   (COPYFILES (PROMPT "COPYING FILE...")
	      (HELP @COPY-HELP)
	      (SOURCE "BBS/COMMANDS/BBSCMD/CD.INFO")
	      (DEST comdir))

  (COMPLETE 90)

  (SET TTYPE
   (ASKNUMBER (PROMPT "Enter the Access-Level required to start\n\nCD-Server in Amiex :")
              (HELP @ASKNUMBER-HELP)
              (DEFAULT 50)))

  (SET AXSLEVEL (cat TTYPE))
  (SET PRGDIR (tackon @default-dest "CD-Server"))
  (TOOLTYPE (DEST (tackon comdir "CD"))
   (SETTOOLTYPE "ACCESS" AXSLEVEL)
   (SETTOOLTYPE "LOCATION" PRGDIR)
   (NOPOSITION))
  (SET mess "Another Tool comming from the \"REAL\" (tRSi/X-iNNOVATiON)")
 ))

;------------- FAME-DOOR DEFINITION INSTALLIEREN --------------------------

(IF (= BBSSYSTEM 0)
 (
  (SET comdir
   (ASKDIR (PROMPT "Please select destination directory for CD-Server's Door definition:")
           (HELP @ASKDIR-HELP)
           (default "FAME:SETTINGS/DOORS/BBSCMD")))
   (COPYFILES (PROMPT "Coping File CD...")
              (HELP @COPY-HELP)
              (SOURCE "FAME/SETTINGS/DOORS/BBSCMD/CD")
              (DEST comdir))
   (SET mess "NOW PLEASE LOAD THE FILE \"CD\" INTO YOUR SYSTEMEDITOR AND EDIT THE PATH TO CD-SERVER IF NEEDED!\n\nAnother Tool comming from the \"REAL\" (tRSi/X-iNNOVATiON)")
))

;-------------------------- INSTALL-ENDE ----------------------------------

(COMPLETE 100)
(EXIT mess)
