;
; Installer Script for a Request v2.1b
; using installer © Commodore
;

(transcript "Installing Request v2.1b ..")

(complete 0)

(message "\n\n\nRequest v2.1b for Amiexpress 4.xx Professional\n\nThis program will automaticly install everything and fix all needed modifications to get the door working")

(set doors_dir "BBS:Doors")

(if	(askbool
			(prompt "\n\n\nDo you want to install the main files for the requester door into a directory ?")
			(help @askbool-help)
    )
		(
			(complete 5)
			(set work_dir
				(tackon doors_dir "Request")
			)
			(copyfiles
				(source "Doors/Request")
				(dest work_dir)
				(infos)
				(all)
			)
    )
)

(complete 10)

(if (askbool
			(prompt "\n\n\nDo you want to install the sample icon into your BBS:Commands/BBSCmd/ ?")
			(help @askbool-help)
    )
    (
			(set door_name
				(askstring
					(prompt "\n\nAs what name should it be called at mainline?")
 					(help @askstring-help)
					(default "req")
				)
    	)
      (complete 20)
			(set acc_lvl
				(asknumber
					(prompt "\n\nSecurity Level to access Request v2.1b\n(ACCESS=<level>)")
					(help @asknumber-help)
					(range 1 500)
    		)
    	)
			(complete 30)
			(copyfiles
				(source "Commands/BBSCmd/req.info")
				(dest "BBS:Commands/BBSCmd")
				(newname
					("%s.info" door_name)
 				)
			)
			(tooltype
				(settooltype "LOCATION"
					(cat doors_dir "/Request/Request")
				)
				(dest
					("BBS:Commands/BBSCmd/%s" door_name)
				)
				(noposition)
			)
			(tooltype
				(settooltype "ACCESS"
					(cat acc_lvl)
				)
				(dest
					("BBS:Commands/BBSCmd/%s" door_name)
				)
				(noposition)
			)
      (complete 40)
			(message
				"\nThese modifications has been made to "door_name".info\n\n"
 	  		"ACCESS="acc_lvl"\n"
   			"LOCATION="doors_dir"/Request/Request\n"
	  	)
	  )
)

(complete 50)

(if (askbool
			(prompt "\n\n\nDo you want to configure the tooltypes of your "doors_dir"/Request/Request.info ?")
			(help @askbool-help)
    )
		(
			(set output
				(askfile
					(prompt "Choose the bulletin-output text\nDoesn't have to exist (BULL.OUTPUT=<path:text>)")
					(help @askfile-help)
					(default
						(expandpath "BBS:")
					)
				)
			)
			(complete 60)
			(tooltype
				(settooltype "BULL.OUTPUT"
					(cat output)
				)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
			)
			(set header
				(askfile
					(prompt "Choose file to use as a header in the bulletin\n(BULL.HEADER=<path:filename>)")
	 				(help @askfile-help)
   				(default
   					(expandpath "Doors:Request/")
   				)
 				)
			)

			(complete 70)

			(tooltype
 				(settooltype "BULL.HEADER"
   				(cat header)
 				)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
 			)
  		(set tail
  			(askfile
  				(prompt "Choose file to use as a tail in the bulletin\n(BULL.TAIL=<path:filename>)")
   				(help @askfile-help)
   				(default
   					(expandpath "Doors:Request/")
   				)
  			)
			)
			(tooltype
  			(settooltype "BULL.TAIL"
   				(cat tail)
  			)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
			)
			(set separator
				"[34m|[0m"
			)
			(complete 80)

			(tooltype
  			(settooltype "BULL.MID_STRING"
   				(cat separator)
  			)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
			)
			(set base
  			(askdir
  				(prompt "Choose messagebase path to request conference\n(MSG.BASE_PATH=<path>)")
   				(help @askdir-help)
   				(default
		 				(expandpath "BBS:")
  	 			)
				)
			)
			(tooltype
	  	 	(settooltype "MSG.BASE_PATH"
      		(cat base "/")
	  		)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
	  	)
			(complete 90)
			(set design
	  		(askfile
			  	(prompt "Choose message pattern (design), to use\n(MSG.PATTERN=<path:textfile.pattern>)")
		 		  (help @askfile-help)
	  	    (default
	    	  	(expandpath "Doors:Request/")
		    	)
		 		)
			)
 			(tooltype
	  		(settooltype "MSG.PATTERN"
  	 			(cat design)
	 			)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
			)
		  (set subject
  			(askstring
  				(prompt "\n\nChoose message-subject to use when creating letters\n(MSG.SUBJECT=<string>)")
	 				(help @askstring-help)
		   		(default "REQUEST v2.1b")
			 	)
			)
	 		(tooltype
  	  	(settooltype "MSG.SUBJECT"
	  			(cat subject)
				)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
		  )
  		(set to
	  		(askstring
  				(prompt "\n\nChoose message-to to use when creating letters\n(MSG.POST_TO=<string>)")
    			(help @askstring-help)
			  	(default "EALL")
				)
	 		)
			(tooltype
  		 	(settooltype "MSG.POST_TO"
    	 		(cat to)
    		)
				(dest
					("Doors:Request/Request")
				)
				(noposition)
			)
      (complete 95)
			(set access
				(asknumber
					(prompt "\n\nAccess level for delete any requests\n(ACS.DELETE_ALL=<access>)")
					(help @asknumber-help)
					(range 10 500)
    		)
			)
)
)

(complete 100)
(message
  "\n\n\nInstallation Complete!\n\nThank you for installing Request v2.1b\n"
  "Copyright © 1994-1995 Neptune 'n Odyssey\n"
)
