; *************************************************************************
;
; CBM Installer Script to install ASM-One Version 1.20 on users hard-drive
;
; This version only works on OS2.0 or higher.
;
; Written by SCHWARZENEGGER/T.F.A
;
;     Written: Mar 05/93
;     Updates: Mar 07/93 - Added Installation for Disk 2/3/4
;                          (which should make installing the includes
;                           and other stuff a little easier)
;              Mar 10/93 - Removed some bugs
;                          Ready for release!
;              Mar 13/93 - Fixed some tiny bugs.
;                          Thanx to REMOTE CONTROL for mentioning this.
;                          (Why did nobody else supplied me with this
;                           information ?)
;
;              Sep  3/93 - Update for new ASM-One (v1.20)
;
;	       Sep 16/93 - Some minor changes for being more user-friendly
;
;                "Combined Forces for the best Assembler!"
;
; *************************************************************************
;

; ************************************************
; * Install - Scherm 1                           *
; ************************************************

(set #asmone-install
(cat "\nAbout ASM-One"
     "\n"
     "\nASM-One Version 1.20"
     "\n"
     "\n(1993) by The Flame Arrows"
     "\n"
     "\nYour distribution-set should consist of"
     "\nfour disks. This installation utility"
     "\nwill install the necessary files on your"
     "\nharddisk-drive."
))

(set #asmone-install-help
(cat "\n'Combined Forces for the best Assembler!'"
     "\n"
     "\nJust click proceed to continue."
     "\n"
     "\nFloppy-disk users should just copy one of"
     "\nthe executables to their own workdisk."
     "\n"
     "\nFloppy-disk users should also extract"
     "\none of the include-file archive to"
     "\na disk if they want to use OS-functions,"
     "\nstructures, etc."
))

; *******************************************
; * Install - Scherm 2                      *
; *******************************************

(set #asmone-install-part2
(cat "\nInstall ASM-One"
     "\n"
     "\nThis installer applies to Version 1.20 of"
     "\nASM-One. This version is quite enhanced"
     "\nover the previous release version (1.16)."
     "\nThis install utility lets you install"
     "\na version of ASM-One that best suits"
     "\nyour system, a set of include files of"
     "\nyour choice and, if you wish, some"
     "\ndocumentation on the Amiga OS."
     "\n\nProceed ?"
))

(set #asmone-install-part2-help
(cat "\nThis section lets you choose in which drawer or on"
     "\nwhich disk the ASM-One files will be installed."
     "\n"
     "\nIf you choose to proceed, you will be asked where you"
     "\nwant the ASM-One files placed.  If you choose"
     "\nto skip this part, you will go to the portion of the"
     "\ninstallation that copies the icon definition files."
     "\n"
     "\nAfter you choose the drawer or disk, you will have"
     "\nthe choice of installing either the ASM-One"
     "\nprogram or a set of include-files or a set of"
     "\nAutoDocs, or both."
))

; ************************************************
; * Finished Installation (finally... :-D)       *
; ************************************************

(set #asmone-install-finished
(cat "\nInstallation of ASM-One has been completed."
     "\n"
     "\nWe hope you will enjoy this new version."
))

(set #asmone-install-finished-help
(cat "\nInstallation of ASM-One has been completed."
     "\n"
     "\nWe hope you will enjoy this new version."
     "\n\n"
     "Contact T.F.A. at +31-(0)35-855918"
     "\n\n"
     "Signed : Price/T.F.A. & Schwarzenegger/T.F.A."
))

; ******************************************
; * Please Insert DISK1                    *
; ******************************************

(set #insert-asmone-disk1
(cat "\nPlease insert disk 1 (Install:) of the ASM-One"
     "\ndistribution disks in any drive."
))

(set #insert-asmone-disk1-help
(cat "\Disk 1 contains the files necessary for"
     "\ninstalling the OS 1.3 or 2.0 version"
     "\nof ASM-One, as well as: the reqtools"
     "\nlibraries, a small part of the AutoDocs"
     "\n(OS3.1/V40) and the AGA.Guide - a"
     "\ncomplete amigaguide helpfile on the"
     "\nnewest Amiga Custom Chips."
))

; ************************************
; * Please Insert DISK2              *
; ************************************

(set #insert-asmone-disk2
(cat "\nPlease insert disk 2 (Include1:) of the ASM-One"
     "\ndistribution disks in any drive."
))

(set #insert-asmone-disk2-help
(cat "\nDisk 2 contains: OS1.3 developer"
     "\nfiles, OS2.0 developer files, and"
     "\na small part of the OS3.1 developer"
     "\nfiles."
))

; **************************************
; * Please Insert DISK3                *
; **************************************

(set #insert-asmone-disk3
(cat "\nPlease insert disk 3 (Include2:) of the ASM-One"
     "\ndistribution disks in any drive."
))

(set #insert-asmone-disk3-help
(cat "\nDisk 3 contains the OS3.1 developer"
     "\nfiles and a part of the OS3.1 AutoDocs."
))

; ****************************************
; * Please Insert DISK4                  *
; ****************************************

(set #insert-asmone-disk4
(cat "\nPlease insert disk 4 (AddOns:) of the ASM-One"
     "\ndistribution disks in any drive."
))

(set #insert-asmone-disk4-help
(cat "\nDisk 4 contains the new ASM-One AGA"
     "\nREGSDATA, the IFF-RAW Converter by"
     "\nTEAM HOI, some replay sources, the ReqTools"
     "\ndeveloper package, some debugtools and some"
     "\nmiscelaneous tools."
))

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** DISK 1 *********************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

; *****************************************
; * Want to Install the AutoDocs ?        *
; *****************************************

(set #install-autodocs
(cat "\nSelect which of the below you want to install."))

(set #install-autodocs-help
(cat "\nThe AutoDocs are very handy when using"
     "\nOS function-calls. They explain the"
     "\nsynopsis of all the OS3.1 functions (and"
     "\nlower) and their functionality. They"
     "\nrequire between 1.5 and 1.8 MB of harddisk"
     "\nspace."
))

; *****************************************************
; Ask the user in which drawer to install the AGA.Guide
; *****************************************************

(set #which-disk-autodocs
(cat "In which disk or drawer should  the AutoDocs files be installed?"
))

(set #which-disk-autodocs-help
(cat "\nThe AutoDocs are very handy when using"
     "\nOS function-calls. They explain the"
     "\nsynopsis of all the OS3.1 functions (and"
     "\nlower) and their functionality. They"
     "\nrequire between 1.5 and 1.8 MB of harddisk"
     "\nspace."
))

; ******************************************************************
; Specific Install Options.
; This applies to install menu 1: which ASM-One version to install ?
; (e.g., 1.3 or 2.0?)
; ******************************************************************

(set #install-asmoneversion
(cat "\nSelect the program version you wish to install."
))

(set #install-asmoneversion-help
(cat "\nChoosing the ASM-One OS 1.3 or OS 2.0 program,"
     "\ninstalls the ASM-One main program in the"
     "\ndirectory of your choise."
     "\n"
     "\nAll ASM-One version are only upwards compatible,"
     "\nwhich means that the 2.0 version will work"
     "\nonly with OS2.0 or higher. If you have OS"
     "\n1.3 or 1.2 installed, use the OS1.3 version"
     "\ninstead."
     @askoptions-help
))

; ***********************************************
; Ask the user in which drawer to install ASM-One
; ***********************************************

(set #whereputasmone
(cat "In which disk or drawer should ASM-One be installed?"
))

(set #whereputasmone-help
(cat "\nThis will usually be a directory on a hard drive"
     "\nnamed ASM-One.  However, you may name it anything"
     "\nyou like.  The install script will create the"
     "\ndirectory if it does not exist.\n\n"
     @askdir-help
))

; *********************************************************
; Install - Menu 3: Applies to readme/distribution/filelist
; *********************************************************

(set #install-whichtextfiles
(cat "\nWhich of these textfiles do you want to install ?"))

(set #install-whichtextfiles-help
(cat "\nThe Changes.txt file marks all the changes"
     "\nbrought about in this version of ASM-One."
     "\n"
     "\nThe Distribution.Readme file gives some"
     "\ninformation on this distribution-set."
     "\n"
     "\nThe Filelist.Doc file gives a list of all the"
     "\nfiles located on each distribution-disk."
     "\n"
     "\nAGA.Guide is an AmigaGuide file with all"
     "\ninformation you'll need about the AGA ChipSet."
     "\n"
     "\nAllmodes.asm is an example of all the 680x0 "
     "\nadressing modes and includes all supported"
     "\n6888x opcodes/adressing modes"
))

; *****************************************************
; Ask the user in which drawer to install the AGA.Guide
; *****************************************************

(set #which-disk-agaguide
(cat "In which disk or drawer should  the file AGA.Guide be installed?"
))

(set #which-disk-agaguide-help
(cat "\nAGA.Guide is an AmigaGuide file with all information"
     "\nabout the AGA ChipSet (and lower)."
     @askdir-help
))

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** DISK 2 *********************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

; ******************************************************
; Install - Menu 4: Applies to which version of the
;                   include/lib/fd/lvo the user wants to
;                   install
; ******************************************************

(set #install-what-devfiles
(cat "\nSelect which version of the OS developer files"
     "\nyou want to install."
))

(set #install-what-devfiles-help
(cat "\nIf you want to use OS-functions, structures"
     "\nyou will need these files. Select a version"
     "\nthat best suits your operating-system."
     "\n"
     "\nAll files choosen are only downwards compatible"
     "\nwhich means that you can use OS1.3 functions"
     "\nusing the OS2.0/3.1 include-files, but"
     "\nnot the other way around."
))

; ****************************************************
; Install - Menu 5-os13: Applies to which files of the
;           1.3 os set the user wants to install
; ****************************************************

(set #install-os13
(cat "\nSelect which parts of the specific OS1.3"
     "\nfiles you want to install."))

(set #install-os13-help
(cat "\nArp.Library is the complete pack for this"
     "\nlibrary (including docs & sources)."
     "\n"
     "\nFD files might come in handy when you want"
     "\nto know what registers to use to call an"
     "\nOS functions."
     "\n"
     "\nInclude files are needed to use system"
     "\nstructures, offsets, etc."
     "\n"
     "\n_LVO's are needed if you want to make"
     "\nfunction-calls (they include all offsets)."
     "\n"
     "\nIn the library package are some linker"
     "\nlibraries supplied (not especially needed"
     "\nfor ASM-One)."
))

; ****************************************************
; Install - Menu 5-os20: Applies to which files of the
;           2.0 os set the user wants to install
; ****************************************************

(set #install-os20
(cat "\nSelect which parts of the specific OS2.0"
     "\nfiles you want to install."))

(set #install-os20-help
(cat "\nFD files might come in handy when you want"
     "\nto know what registers to use to call an"
     "\nOS functions."
     "\n"
     "\nInclude files are needed to use system"
     "\nstructures, offsets, etc."
     "\n"
     "\n_LVO's are needed if you want to make"
     "\nfunction-calls (they include all offsets)."
     "\n"
     "\nIn the library package are some linker"
     "\nlibraries supplied (not especially needed"
     "\nfor ASM-One)."
     "\n"
     "\nThe startup package contains all code and"
     "\ninformation you'll need to let your"
     "\nprograms startup in an OS friendly way."
))

; ****************************************************
; Install - Menu 5-os31: Applies to which files of the
;           3.0 os set the user wants to install
; ****************************************************

(set #install-os31
(cat "\nSelect which parts of the specific OS3.1"
     "\nfiles you want to install."))

(set #install-os31-help
(cat "\nFD files might come in handy when you want"
     "\nto know what registers to use to call an"
     "\nOS functions."
     "\n"
     "\nInclude files are needed to use system"
     "\nstructures, offsets, etc."
     "\n"
     "\n_LVO's are needed if you want to make"
     "\nfunction-calls (they include all offsets)."
     "\n"
     "\nIn the library package are some linker"
     "\nlibraries supplied (not especially needed"
     "\nfor ASM-One)."
     "\n"
     "\nThe startup package contains all code and"
     "\ninformation you'll need to let your"
     "\nprograms startup in an OS friendly way."
     "\n"
     "\nThe documentation contains some specific"
     "\nOS3.1 (version 40) documentation.,"
     "\nincluding : 68040 / V39 compatibility"
     "\nnotes among others."
))

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** DISK 3 *********************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** DISK 4 *********************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

; ****************************************************
; Want to Install the Tools ? (FD2LVO, BLINK, SRSPLIT)
; ****************************************************

(set #install-tools
(cat "\nSelect if you want to install the tools."))

(set #install-tools-help
(cat "\nThere are several small utils located inside"
     "\nthe tools archive."
     "\n"
     "\nAmong them are: BLink (Public Domain Linker),"
     "\nwhich you might use to combine assembler and"
     "\nC code, FD2LVO (including documentation);"
     "\na utility to convert Commodore FD files to"
     "\n_LVO files (by HISOFT; not entirely A4000"
     "\ncompatible (but it works :-D)."
     "\nTeam Hoi's RAWAGA converter. The best WORKING"
     "\nconverter which handles AGA formats"
))

; ************************************************
; Ask the user if which drawer to install Enforcer
; ************************************************

(set #which-disk-debugtools
(cat "In which disk or drawer should Enforcer and/or Sushi be installed?"
))

(set #which-disk-debugtools-help
(cat "\nThis will usually be a directory on a hard drive"
     "\nnamed Enforcer or Utils.  However, you may name"
     "\nit anything you like.  The install script will"
     "\ncreate the directory if it does not exist."
     "\nEnforcer is a debug tool from Commodore that"
     "\nrequires an MMU. Sushi is a tool for catching"
     "\nkprintf() / Enforcer output to console.\n\n"
     @askdir-help
))

(set #install-debugtools
(cat "\nSelect which items to install."
))

(set #install-debugtools-help
(cat "\nEnforcer is a debug tool from Commodore that"
     "\nrequires an MMU. Sushi is a tool for catching"
     "\nkprintf() / Enforcer output to console.\n\n"
     @askdir-help
))

; ********************************************************
; Install - Menu 2: Applies to REGSDATA & REQTOOLS PACKAGE
; ********************************************************

(set #install-regsdata-reqtools
(cat "\nSelect which items to install."
))

(set #install-regsdata-reqtools-help
(cat "\nRegister Data is needed if you want"
     "\nonline information about register names"
     "\nand functions. This file will be copied"
     "\nin your S:. Remember: the old REGSDATA"
     "\nfiles are NOT compatible with this new"
     "\nversion of ASM-One."
     "\n\n"
     "If you want to use your own requesters"
     "\nchoose for installation of the ReqTools"
     "\npackage."
))

; ************************************************
; Ask the user if which drawer to install ReqTools
; ************************************************

(set #which-disk-reqtools
(cat "In which disk or drawer should ReqTools be installed?"
))

(set #which-disk-reqtools-help
(cat "\nThis will usually be a directory on a hard drive"
     "\nnamed ASM-One or Sources.  However, you may name"
     "\nit anything you like.  The install script will"
     "\ncreate the directory if it does not exist.\n\n"
     @askdir-help
))


; ***********************************************
; Ask the user if which drawer to install Sources
; ***********************************************

(set #which-disk-replay
(cat "In which drawer should the Replay-Source be installed?"
))

(set #which-disk-replay-help
(cat "\nThis will usually be a directory on a hard drive"
     "\nnamed SOURCES: or ASM-One.  However, you may name"
     "\nit anything you like.  The install script will"
     "\ncreate the directory if it does not exist.\n\n"
     @askdir-help
))

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** GENERAL ********************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

; ***********************************
; Specified directory does not exists
; ***********************************

(set #thatdirne
(cat "\n\nThe directory you specified does not exist."
     "\nDo you want to create it?"
))

(set #thatdirne-help
(cat "\nYou specified a directory that does not exist."
     "\n\nIf you choose Yes, the directory will be created."
     "\n\nIf you choose No, you will have the opportunity to"
     "\nspecify another directory."
))

;*************************************************************************
;*************************************************************************
;*************************************************************************
;******************************** JUMP IN! *******************************
;*************************************************************************
;*************************************************************************
;*************************************************************************

; ***********************************************************
;                Start of the Main Program!
; ***********************************************************

; * 2 elementary messages. We want the user to know this
; * is yet another T.F.A. production :-).

(if (askbool (prompt #asmone-install)
             (help #asmone-install-help)
             (choices "Continue" "End Installation")
             (default 0))
(
(if (askbool (prompt #asmone-install-part2)
             (help #asmone-install-part2-help)
             (choices "Yes" "End Installation")
             (default 1) )
(

; ****************************************************
; * Now, set the default directory for search a path *
; ****************************************************

	(set asmonedir (getassign "Work" "v"))

	; *****************************************************
	; * Did we get anything ? If not, set default to sys: *
	; *****************************************************

	( if (= asmonedir "") (set asmonedir "sys:") )
	(set goodresp FALSE)

	(while (= goodresp FALSE)
	(
		(set target (askdir (prompt #whereputasmone)
			    (help #whereputasmone-help)
			    (newpath)
			    (default "Work:ASM-One")))

		(if (not (exists target))
		(
				(if (askbool (prompt (#thatdirne))
					     (help (#thatdirne-help))
					      (default 0) )
				(
					(makedir target (infos) )
					(set goodresp TRUE)
				))
		)
		(
			(set goodresp TRUE)
		)
		)
	)
	)

	(set asmonedir target)
	(set @default-dest target)


	(set vernum (getversion "exec.library" (resident)))
	(set ver (/ vernum 65536))
	(if (< ver 36)
	  (
            (set defa 0)
          )
          (
            (set defa 1)
          )
        )

	; * First look which version of ASM-One the user
	; * wishes to install (either 1.3 or 2.0 version)

	(set prt1 (askchoice (prompt #install-asmoneversion)
			     (help #install-asmoneversion-help)
			     (choices "ASM-One V1.20 for Release 1.3+"
                                      "ASM-One V1.20 for Release 2.0+"
			     (default defa)
                             )
                  )
        )

	; *********************
        ; * ASM-One for OS1.3 *
	; *********************


	(if (= prt1 1)
	(
		(if (not (getassign "Install" "d"))
		(
				(askdisk (prompt #insert-asmone-disk1)
						 (help #insert-asmone-disk1-help)
						 (dest "Install")
					)
		)
		)
        )
	(
		(working "Extracting ASM-One 1.20 for OS1.3")
		(run ("Install:C/lz x %s %s/" "Install:Program/ASM-One_OS13.lha" asmonedir))
	)
        )

        ; ******************************
	; * Install ASM-One for OS2.0+ *
        ; ******************************

	(if (= prt1 0)
		(
			(if (not (getassign "Install" "d"))
			(
				(askdisk (prompt #insert-asmone-disk1)
					 (help #insert-asmone-disk1-help)
					 (dest "Install")
				)
			)
			)
		)
		(
			(working "Extracting ASM-One 1.20 for OS2.0 or higher.")
			(run ("Install:C/lz x %s %s/" "Install:Program/ASM-One_OS20.lha" asmonedir))
		)
        )


	(if (< ver 36)
		(copylib
		(help @copylib-help)
		(prompt "Installing reqtools.library")
		(confirm)
                (source "Install:libs13/reqtools.library")
                (dest
		(askdir
		(prompt "Please select a place for \"reqtools.library\".")
		(help @askdir-help)
		(default "LIBS:")
		)
		)
                )
        )

	(if (> ver 35)
		(copylib
			(help @copylib-help)
			(prompt "Installing reqtools.library")
			(confirm)
		        (source "Install:libs20/reqtools.library")
			(dest
			(askdir
			(prompt "Please select a place for \"reqtools.library\".")
			(help @askdir-help)
			(default "LIBS:")
			)
			)
		)
	)

	; ****************************************************
	; * Which Text Files does the user wish to install ? *
	; ****************************************************

	(set prt3 (askoptions (prompt #install-whichtextfiles)
			      (help #install-whichtextfiles-help)
			      (choices "Changes.Readme"
			               "Distribution.Readme"
			               "FileList.Doc"
			               "AGA.Guide"
				       "Allmodes.asm"
			      )
    		  )
	)

	; ********************************
	; Copy the Changes.Readme
	; ********************************

	(if (IN prt3 0)
	(
		(copyfiles (source "Install:Changes.txt")
		           (dest asmonedir)
                           (infos)
        	)

		(copyfiles (source "Install:Changes.txt.info")
		           (dest asmonedir)
		           (infos)
		)
	)
	)

	; ************************************
	; Copy the Distribution.Readme
	; ************************************

	(if (IN prt3 1)
	(
		(copyfiles (source "Install:Distribution.Readme")
	 	           (dest asmonedir)
                           (infos)
                )

		(copyfiles (source "Install:Distribution.Readme.info")
		           (dest asmonedir)
                           (infos)
                )
	)
	)

	; ****************************
	; Copy the Allmodes.asm
	; ****************************

	(if (IN prt3 4)
	(
		(copyfiles (source "Install:Allmodes.asm")
		           (dest asmonedir)
                           (infos)
                )

	)
	)

	; ****************************
	; Copy the FileList.Doc
	; ****************************

	(if (IN prt3 2)
	(
		(copyfiles (source "Install:FileList.Doc")
		           (dest asmonedir)
                           (infos)
                )

		(copyfiles (source "Install:FileList.Doc.info")
		           (dest asmonedir)
                           (infos)
                )
	)
	)

	; *****************************
	; Copy the AGA.Guide
	; *****************************

	(set agadir (getassign "Work" "v"))
	(if (= agadir "") (set agadir "sys:"))
	(set goodresp FALSE)
	(set agadir target)

	(if (IN prt3 3)
	(

		(while (= goodresp FALSE)
		(
			(set target (askdir (prompt #which-disk-agaguide)
				    (help #which-disk-agaguide-help)
				    (newpath)
				    (default asmonedir) ))

			(if (not (exists target))
			(
				(if (askbool (prompt (#thatdirne))
					(help (#thatdirne-help))
					(default 0) )
				(
					(makedir target (infos) )
					(set goodresp TRUE)
				))
			)
			(
				(set goodresp TRUE)
			)
			)
		) )

		(copyfiles (source "Install:AGA.Guide")
		           (dest agadir)
      		           (infos)
                )

		(copyfiles (source "Install:AGA.Guide.info")
		           (dest agadir)
                )
	)
	)

	; ************************************************************
	; Now, let's see if the user wants to install the 3.1 AutoDocs
        ; ************************************************************

	(set autodocs (askoptions (prompt #install-autodocs)
	              (help #install-autodocs-help)
                      (choices "AutoDocs OS 3.1 (V40)")
                      (default 2)
                      )
        )

	(if (IN autodocs 0)
	(
		(set autodocsdir (getassign "Work" "v"))
		( if (= autodocsdir "") (set autodocsdir "sys:") )
		(set goodresp FALSE)
		(set autodocsdir target)

		(while (= goodresp FALSE)
		(
			(set target (askdir (prompt #which-disk-autodocs)
				    (help #which-disk-autodocs-help)
				    (newpath)
				    (default asmonedir)))

			(if (not (exists target))
			(
				(if (askbool (prompt (#agadir-no-exist))
					(help (#agadir-no-exist-help))
					(default 0) )
						(
							(makedir target (infos) )
							(set goodresp TRUE)
						))
					)
					(
						(set goodresp TRUE)
					)
			)
		)
		)

		(if (not (getassign "Install" "d"))
		(
			(askdisk (prompt #insert-asmone-disk1)
			         (help #insert-asmone-disk1-help)
                                 (dest "Install")
			)
		)
		)

		(working "Working on extracting AutoDocs 3.1 (V40) archive.")
		(run ("Install:C/lz x %s %s/" "Install:Release3.1/AutoDocs3.1.lha" autodocsdir))

		; ************************************************************
		; Now Insert Disk 3 in any drive, so we can continue our work.
		; ************************************************************

		(if (not (getassign "Include2" "d"))
		(
			(askdisk (prompt #insert-asmone-disk3)
			         (help #insert-asmone-disk3-help)
                                 (dest "Include2")
			)
		)
		)

		(working "Working on extracting AutoDocs 3.1 (V40) archive.")
		(run ("Include2:C/lz x %s %s/" "Include2:Release3.1/AutoDocs3.1.lha" autodocsdir))
	)
	)

        ; ********************************************************
	; First ask which version of include/lib and fd files the
	; user wants to install
	; ********************************************************

	(if (< ver 36)
         (
	  (set defa 0)
         )
         (
	  (if (< ver 39)
            ((set defa 1))
            ((set defa 2))
          )
         )
        )


	(set prt4 (askchoice (prompt #install-what-devfiles)
  		  (help #install-what-devfiles-help)
		  (choices "Include/FD/Lib for OS1.3"
		           "Include/FD/Lib for OS2.0"
                           "Include/FD/Lib for OS3.1"
		  (default defa)
                  )
		  )
	)

	; ********************************************************
	; ********************************************************
	; ********************************************************
	; ************************** OS1.3! :- ******************
	; ********************************************************
	; ********************************************************
	; ********************************************************

	(if (= prt4 0)
	(
		(set prt5 (askoptions (prompt #install-os13)
		                      (help #install-os13-help)
			  (choices "Arp.Library"
			           "FD Files"
			 	   "Include Files"
				   "Library Files"
				   "_LVO Files"
			  )
			  )
		)

		(if (not (getassign "Include1" "d"))
		(
			(askdisk (prompt #insert-asmone-disk2)
  		                 (help #insert-asmone-disk2-help)
				 (dest "Include1")
			)
		)
		)

		; ************************
		; Arp.Library
		; ************************

		(if (IN prt5 0)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting ARP archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release1.3/Arp1.3.lha" target))
        	)
		)

        	; **********************
		; FD Files
		; **********************

		(if (IN prt5 1)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting FD archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release1.3/FD1.3.lha" target))
		)
		)

		; **********************
		; Include Files
		; **********************

		(if (IN prt5 2)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Include archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release1.3/Include1.3.lha" target))
		)
		)

		; ****************************
		; Library Files
		; ****************************

		(if (IN prt5 3)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Lib archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release1.3/Lib1.3.lha" target))
		)
		)

		; ********************
		; _LVO Files
		; ********************

		(if (IN prt5 4)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting LVO archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release1.3/LVO1.3.lha" target))
			)
		)

	)
	)

	; ********************************************************
	; ********************************************************
	; ********************************************************
	; ************************** OS2.0! :- ******************
	; ********************************************************
	; ********************************************************
	; ********************************************************

	(if (= prt4 1)
	(
		(set prt5 (askoptions (prompt #install-os20)
		          (help #install-os20-help)
		          (choices	"FD Files"
					"Include Files"
					"Library Files"
					"_LVO Files"
					"Startup Files"
			  )
			  )
		)

		(if (not (getassign "Include1" "d"))
		(
			(askdisk (prompt #insert-asmone-disk2)
			         (help #insert-asmone-disk2-help)
			         (dest "Include1")
			)
		)
		)

		; *****************
		; FD Files
		; *****************

		(if (IN prt5 0)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting FD archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release2.0/FD2.0.lha" target))
		)
		)

                ; ***********************
		; Include Files
		; ***********************

		(if (IN prt5 1)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Include archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release2.0/Include2.0.lha" target))
		)
		)

		; ***********************
		; Library Files
		; ***********************

		(if (IN prt5 2)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Lib archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release2.0/Lib2.0.lha" target))
		)
		)

		; ********************
		; _LVO Files
		; ********************

		(if (IN prt5 3)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting LVO archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release2.0/LVO2.0.lha" target))
		)
		)

		; *******************
		; Startup Files
		; *******************

		(if (IN prt5 4)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Startups archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release2.0/Startups2.0.lha" target))
		)
		)
	)
	)

	; ********************************************************
	; ********************************************************
	; ********************************************************
	; ************************** OS3.1! :- ******************
	; ********************************************************
	; ********************************************************
	; ********************************************************

	(if (= prt4 2)
	(
		(set prt5 (askoptions (prompt #install-os31)
		          (help #install-what5-os31-help)
			  (choices    "FD Files"
                		      "Include Files"
				      "Library Files"
				      "_LVO Files"
				      "Startup Files"
			              "Documentation"
			  )
			  )
		)

		(if (not (getassign "Include1" "d"))
		(
			(askdisk (prompt #insert-asmone-disk2)
  		                 (help #insert-asmone-disk2-help)
				 (dest "Include1")
			)
		)
		)

        	; **********************************
		; * Startup Files                  *
		; **********************************

		(if (IN prt5 4)
	 	(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Startup archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release2.0/Startups2.0.lha" target))

		)
		)

                ; **********************
		; * Includes (partly!) *
		; **********************

		(if (IN prt5 1)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Include archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release3.1/Includes3.1.lha" target))
		)
		)

		; **************************
		; * LIB Archive            *
		; **************************

		(if (IN prt5 2)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Lib archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release3.1/Libs3.1.lha" target))
		)
		)

		; *********************
                ; * V39 Docs          *
		; *********************

		(if (IN prt5 5)
		(
			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Documentation archive.")
			(run ("Include1:C/lz x %s %s/" "Include1:Release3.1/Docs3.1.lha" target))
		)
		)

		(if (IN prt5 1)
		(
			(if (not (getassign "Include2" "d"))
			(
				 (askdisk (prompt #insert-asmone-disk3)
		  		       (help #insert-asmone-disk3-help)
      			       	       (dest "Include2")
                                 )
			)
			)

			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting Include archive.")
			(run ("Include2:C/lz x %s %s/" "Include2:Release3.1/Includes3.1.lha" target))
		)
		)

		; **********************************************
		; **********************************************
		; **********************************************
                ; ****************** DISK 4 !!!!!! *************
		; **********************************************
		; **********************************************
		; **********************************************

		; ******************************
		; FD Files
		; ******************************

		(if (IN prt5 0)
		(
			(if (not (getassign "AddOns" "d"))
			(
				 (askdisk (prompt #insert-asmone-disk4)
		  		       (help #insert-asmone-disk4-help)
      			       	       (dest "AddOns")
                                 )
			)
			)

			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting FD archive.")
			(run ("AddOns:C/lz x %s %s/" "AddOns:Release3.1/FD3.1.lha" target))
		)
		)

		(if (IN prt5 3)
		(
			(if (not (getassign "AddOns" "d"))
			(
				 (askdisk (prompt #insert-asmone-disk4)
		  		       (help #insert-asmone-disk4-help)
      			       	       (dest "AddOns")
                                 )
			)
			)

			(set asmonedir target)
			(set @default-dest target)

			(working "Working on extracting LVO archive.")
			(run ("AddOns:C/lz x %s %s/" "AddOns:Release3.1/LVO3.1.lha" target))
		)
		)

	)
	)

	; **************************************************************
	; **************************************************************
	; **************************************************************
	; ***************************** DISK 4 *************************
	; **************************************************************
	; **************************************************************
	; **************************************************************

	(set prt2 (askoptions (prompt #install-regsdata-reqtools)
 			      (help #install-regsdata-reqtools-help)
			      (choices "RegsData"
				       "ReqTools Developer Package")
		              (default 0)
                  )
	)

	; ************************************************
	; Copy Reqtools ? Reqtools needs to be extraced!
	; Note that we do not check the disk until a new
	; disk needs to be inserted!
	; ************************************************

	(if (IN prt2 1)
	(
		; **************************************
		; Ask the user for a ReqTools Directory.
		; **************************************

		(set reqtoolsdir (getassign "Work" "v"))
		(if (= reqtoolsdir "") (set reqtoolsdir "sys:"))
		(set goodresp FALSE)
		(while (= goodresp FALSE)
		(
			(set target (askdir (prompt #which-disk-reqtools)
		                    (help #which-disk-reqtools-help)
				    (newpath)
  				    (default asmonedir) ))

			(if (not (exists target))
                        (
				(if (askbool (prompt (#thatdirne))
	  				     (help (#thatdirne-help))
					     (default 0) )
					     (
						(makedir target (infos) )
						(set goodresp TRUE)
					     )
				)
                        )
			(
				(set goodresp TRUE)
			)
			)
		)
		)

		(if (not (getassign "AddOns" "d"))
		(
			 (askdisk (prompt #insert-asmone-disk4)
	  		       (help #insert-asmone-disk4-help)
		       	       (dest "AddOns")
                         )
		)
		)

		(set reqtoolsdir target)
		(set @default-dest target)

		(
			(working "Working on extracting ReqTools archive.")
			(run ("AddOns:C/lz x %s %s/" "AddOns:ReqTools/REQTOOLS.lha" target))
		)
        )
	)

	; ************************************************************
	; Copy REGSDATA ?
	; ************************************************************

	(if (IN prt2 0)
	(
		(if (not (getassign "AddOns" "d"))
		(
			 (askdisk (prompt #insert-asmone-disk4)
	  		       (help #insert-asmone-disk4-help)
		       	       (dest "AddOns")
                         )
		)
		)

		(
			(working "Working on extracting REGSDATA archive.")
			(run ("AddOns:C/lz x AddOns:Misc/REGSDTA.lha S:"))
		)
	)
	)

	(set prt6 (askoptions (prompt #install-tools)
                  (help #install-tools-help)
                  (choices "Tools")
                  (default 0)
	          )
	)

	(if (IN prt6 0)
	(
		(if (not (getassign "AddOns" "d"))
		(
			(askdisk (prompt #insert-asmone-disk4)
		        (help #insert-asmone-disk4-help)
        	        (dest "AddOns")
			)
		)
		)

		(set asmonedir target)
		(set @default-dest target)

		(working "Working on extracting Tools archive.")
		(run ("AddOns:C/lz x %s %s/" "AddOns:Tools/Tools.lha" target))
		(run ("AddOns:C/lz x %s %s/" "AddOns:RAWAGA/RawAga.lha" target))

	)
	)

	(set prt7 (askoptions (prompt #install-what8)
                  (help #install-what8-help)
                  (choices "Replay Routines")
                  (default 0)
                  )
        )

	(if (IN prt7 0)
	(
		(set defrepldir asmonedir)
		(set defrepldir (tackon defrepldir "replays"))
		(set replaydir (getassign "Work" "v"))
		(if (= replaydir "") (set replaydir "sys:"))
		(set goodresp FALSE)
		(while (= goodresp FALSE)
		(
			(set target (askdir (prompt #which-disk-replay)
	                            (help #which-disk-replay-help)
                                    (newpath)
                                    (default defrepldir)
				    )
			)

                        (if (not (exists target))
			(
				(if (askbool (prompt (#thatdirne))
					(help (#thatdirne-help))
					(default 0) )
					(
						(makedir target (infos) )
						(set goodresp TRUE)
					)
				)
			)
			(
				(set goodresp TRUE)
			)
                        )
		)
		)

		(if (not (getassign "AddOns" "d"))
		(
			(askdisk (prompt #insert-asmone-disk4)
		        (help #insert-asmone-disk4-help)
        	        (dest "AddOns")
			)
		)
		)

		(set replaydir target)
		(set @default-dest target)

		(Copyfiles (source "AddOns:Replays/Future-Replay.S")
  		           (dest replaydir)
			   (infos)
		)

		(Copyfiles (source "AddOns:Replays/ST-8Replay.S")
  		           (dest replaydir)
			   (infos)
		)

		(Copyfiles (source "AddOns:Replays/NOISE-Replay.S")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/PPReplay.s")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/PT-Play.s")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/PT.FileFormat.txt")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/ST-Amreplay.S")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/NOISE-Fastreplay.S")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/NP3Replay.S")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/PT.Effects.txt")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/ST-8Replay.S")
			         (dest replaydir)
		           (infos)
		)

		(Copyfiles (source "AddOns:Replays/ST-Normalreplay.S")
			         (dest replaydir)
		           (infos)
		)
	)
	)

	(set prt8 (askoptions (prompt #install-debugtools)
                  (help #install-debugtools-help)
		  (choices "Enforcer"
                           "Sushi")
                  (default 0)
                  )
        )


	(if (OR (in prt8 0) (in prt8 1))
	(
		(set enforcerdir (getassign "Work" "v"))
		(set defenfdir asmonedir)
		(set defenfdir (tackon defenfdir "Debugtools"))
		(if (= enforcerdir "") (set enforcerdir "sys:"))
		(set goodresp FALSE)
		(while (= goodresp FALSE)
		(
			(set target (askdir (prompt #which-disk-debugtools)
                        		(help #which-disk-debugtools-help)
		                        (newpath)
                		        (default defenfdir)
				     )
			)

			(if (not (exists target))
			(
				(if (askbool (prompt (#thatdirne))
			  	  	     (help (#thatdirne-help))
					     (default 0) )
                                             (
						(makedir target (infos) )
						(set goodresp TRUE)
				  	     )
				)
			)
			(
				(set goodresp TRUE)
			)
			)
		)
		)
		(set enforcerdir target)
		(set @default-dest target)


	(if (not (getassign "AddOns" "d"))
	(
		(askdisk (prompt #insert-asmone-disk4)
                	 (help #insert-asmone-disk4-help)
               		 (dest "AddOns")
        	)
	)
	)


	(if (IN prt8 0)
	(
		(working "Working on extracting the Enforcer archive.")
		(run ("AddOns:C/lz x %s %s/" "AddOns:DebugTools/Enforcer37_49.lha" target))

		(Copyfiles (source "AddOns:DebugTools/Enforcer37_49.readme")
 		           (dest enforcerdir)
		           (infos)
		)
	)
	)

	(if (IN prt8 1)
	(
		(set sushidir enforcerdir)
		(set sushidir target)
		(set @default-dest target)

                (working "Working on extracting the Sushi archive.")
		(run ("AddOns:C/lz x %s %s/" "AddOns:DebugTools/Sushi37_7.lzh" target))

		(Copyfiles (source "AddOns:DebugTools/Sushi37_7.readme")
		           (dest sushidir)
			   (infos)
		)
	)
        )

        ))
)
)

	(askbool (prompt #asmone-install-finished)
		 (help #asmone-install-finished-help)
                 (choices "Proceed")
	         (default 0))

	(set target asmonedir)
	(set @default-dest target)
)

)
