; CBM Installer Script to install ASM-One Version 1.15 on users hard-drive
;          by: SCHWARZENEGGER of The Royal Amiga Force
;     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
;                          Release date!
;
;              Mar 13/93 - Fixed some tiny bugs.
;                          Thanx to REMOTE CONTROL for mentioning this.
;                          (Why did nobody else supplied me with this
;                           information ?)
;
;                "Joined Forces for the best Assembler!"
;-------------------------------------------------------------------------
;Notes:
;------->
;   (1) I wrote this because its much more friendly for a user to
;       install a new program using a script. This way, everything
;       will automatically be placed where-ever the user wants
;       (and where ASM-One wants it!)
;
;   (2) This is a HardDisk Install Utility! Do not try this on floppy
;       because it won't fit!
;
;   (3) I did not have the time to make a floppy drive installation
;       utility. Maybe the next release version of ASM-One will have
;       such a utility.
;
;   (4) Use TABSIZE = 2 for reading this file
;
; ************************************************************
;    Here are some procedures we want our installer to use.
; ************************************************************

(set #asmone-install
(cat "\nAbout ASM-One"
     "\n"
     "\nASM-One Version 1.15"
     "\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 "\nOur slogan is:"
     "\n'Joined Forces for the best Assembler!'"
     "\n"
     "\nJust click proceed to continue."
     "\n"
     "\nFloppy-disk users should just copy one of"
     "\nthe executables (in the Install:Program"
     "\ndrawer) to their own workdisk, and"
     "\nmake sure they copy the Env Archive/"
     "\nASM-Prefs file to either their S: drawer"
     "\n(only when using the OS 1.3 version of"
     "\nASM-One) or to their ENVARC: and ENV: drawer"
     "\nand copying the ASM-One.Prefs file to it."
     "\n(Or just copy it to ENVARC: and then reboot)."
     "\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."
))

;----------------------------------------
; Installation has finished. Notify user.
;----------------------------------------

(set #asmone-install-finished
(cat "\nInstallation of ASM-One has finished."
     "\nYou might want to add some assigns"
     "\nto your user-startup file (when"
     "\nusing OS2.0+) or your startup-sequence"
     "\nfile (when using OS1.3) by yourself."
     "\n(e.g., SOURCES:)."
))

;----------------------
; Startup Text - Part 2
;----------------------

(set #asmone-install-part2
(cat "\nInstall ASM-One"
	"\n"
	"\nThis installer applies to Version 1.15 of"
	"\nASM-One. This version is quite enhanced"
	"\nover the previous release version (1.09)."
	"\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."
))

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

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

(set #which-disk-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
))

;-------------------------------------------------
; 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 Scrammer
;-------------------------------------------------
(set #which-disk-scrammer
(cat "In which disk or drawer should Scrammer be installed?"
))

(set #which-disk-scrammer-help
(cat "\nThis will usually be a directory on a hard drive"
     "\nnamed Scrammer or Utils.  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 Enforcer
;-------------------------------------------------
(set #which-disk-enforcer
(cat "In which disk or drawer should ReqTools be installed?"
))

(set #which-disk-enforcer-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.\n\n"
     @askdir-help
))

;-------------------------------------------------
; Ask the user if which drawer to install Sushi
;-------------------------------------------------
(set #which-disk-sushi
(cat "In which disk or drawer should ReqTools be installed?"
))

(set #which-disk-sushi-help
(cat "\nThis will usually be a directory on a hard drive"
     "\nnamed Utils or Sushi.  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 Sushi
;-------------------------------------------------
(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 Utils or Sushi.  However, you may name"
     "\nit anything you like.  The install script will"
     "\ncreate the directory if it does not exist.\n\n"
     @askdir-help
))

;------------------------------------
; Specified directory does not exists
;------------------------------------

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

(set #asmonedir-no-exist-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."
))

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

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

(set #install-what-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 upward 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
))

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

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

(set #install-what2-help
(cat "\nRegister Data is needed if you want"
     "\nonline information about register names"
     "\nand functions. This file will be copied"
     "\nin your S:"
     "\n\n"
     "If you want to use your own requesters"
     "\nchoose for installation of the ReqTools"
     "\npackage."
))

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

(set #install-what3
(cat "\nSelect which textfiles you want to install."))

(set #install-what3-help
(cat "\nThe Changes.Readme 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."
))

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

(set #install-what4
(cat "\nSelect which version of the include, fd,"
     "\nlibrary and LVO's you want to install."
))

(set #install-what4-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 downwards compatible"
     "\nwhich meands that you can use OS1.3 functions"
     "\nusing the OS2.0/3.0 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-what5-os13
(cat "\nSelect which parts of the specific OS1.3"
     "\nfiles you want to install."))

(set #install-what5-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-what5-os20
(cat "\nSelect which parts of the specific OS2.0"
     "\nfiles you want to install."))

(set #install-what5-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-os30: Applies to which files of the
;           3.0 os set the user wants to install
;----------------------------------------------------------

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

(set #install-what5-os30-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.0 (version 39) documentation.,"
     "\nincluding : 68040 / V39 compatibility"
     "\nnotes among others."
))

;------------------------------------------------
; Install - Menu 6: Applies to the Tools (Disk 3)
;------------------------------------------------

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

(set #install-what6-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, and FD2LVO (including documentation);"
     "\na utility to convert Commodore FD files to"
     "\n_LVO files (by HISOFT; not entirely A4000"
     "\ncompatible (but it works))."
))

;------------------------------------------------
; Install - Menu 7: Applies to the OS3.0 AutoDocs
;------------------------------------------------

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

(set #install-what7-help
(cat "\nThe AutoDocs are very handy when using"
     "\nOS function-calls. They explain the"
     "\nsynopsis of all the OS3.0 functions (and"
     "\nlower) and their functionality. They"
     "\nrequire between 1.5 and 1.8 MB of harddisk"
     "\nspace."
     "\n"
     "All the replay routines will be copied"
     "\nyou'll need for playing your own music"
     "\nin your own programs."
))

;------------------------------------------------
; Install - Menu 8: Applies to the Debug Tools
;------------------------------------------------

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

(set #install-what8-help
(cat "\nEnforcer requires a MMU, and attempts"
     "\nto find hits/illegal memory calls."
     "\n"
     "\nSushi is a redirecting utility (read the"
     "\ndocs for more information)."
     "\n"
     "\nScrammer lets you select/de-select and"
     "\nfind out which specific CPU options are"
     "\nturned on or off. It also has some test"
     "\nfunctions."
))

;-----------------------------------
; Ask for insertion of asmone DISK 1
;-----------------------------------

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

; Ask for insertion of asmone DISK 1 - HELP

(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."
))

;-----------------------------------
; Ask for insertion of asmone DISK 2
;-----------------------------------

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

; Ask for insertion of asmone DISK 2 - HELP

(set #insert-asmone-disk2-help
(cat "\nDisk 2 contains both the OS1.3 include files"
     "\nand the OS2.0 include files."
))

;-----------------------------------
; Ask for insertion of asmone DISK 3
;-----------------------------------

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

; Ask for insertion of asmone DISK 3 - HELP

(set #insert-asmone-disk3-help
(cat "\nDisk 3 contains the OS3.0 include files"
     "\nand some tools you might want to install."
))

;-----------------------------------
; Ask for insertion of asmone DISK 4
;-----------------------------------

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

; Ask for insertion of asmone DISK 4 - HELP

(set #insert-asmone-disk4-help
(cat "\nDisk 4 contains the OS 3.0 AutoDocs (documen-"
     "\ntation on specific OS routines and some"
     "\nquite useful utilities/sources."
     "\n"
     "\nAlso located on disk 4 are some debug"
     "\ntools and some 3.0 library / fd files."
))

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

	(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 #which-disk)
				    (help #which-disk-help)
				    (newpath)
				    (default "Work:ASM-One") ))

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

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

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

		(set prt1 (askchoice (prompt #install-what)
				     (help #install-what-help)
				     (choices
 					"ASM-One V1.15 for Release 1.3+"
					"ASM-One V1.15 for Release 2.0+"
				     )
				)
			 
		)

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

			(Copyfiles (source "Install:program/ASM-One_OS1.3")
				   (dest asmonedir)
				   (infos)
			)

			(Copyfiles (source "Install:program/ASM-One_OS1.3.info")
				   (dest asmonedir)
				   (infos)
			)

		)

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

			(Copyfiles (source "Install:program/ASM-One_OS2.0")
				   (dest asmonedir)
				   (infos)
				)
			(Copyfiles (source "Install:program/ASM-One_OS2.0.info")
				   (dest asmonedir)
				   (infos)
				)

		)

		(if (= prt1 0)
			(
				(Copyfiles (source "Install:Env/ASM-One.Pref")
					   (dest "S:")
					   (infos)
				)

				(Copyfiles (source "Install:Libs/ReqTools.library")
					   (dest "LIBS:")
					   (infos)
				)
			)
		)

		(if (= prt1 1)
			(
				; Copy AsmOne-Prefs file to ENVARC:
				(Copyfiles (source "Install:Env/ASM-One.Pref")
					   (dest "ENVARC:")
					   (infos)
					)
				; Copy AsmOne-Prefs file to ENV:

				(Copyfiles (source "Install:Env/ASM-One.Pref")
					   (dest "ENV:")
					   (infos)
				)

				(Copyfiles (source "Install:ReqTools.library")
					   (dest "LIBS:")
					   (infos)
				)

			)
		)

		; Now let's see which textfile(s) the user wants to install

		(set prt3 (askoptions (prompt #install-what3)
				      (help #install-what3-help)
				      (choices "Changes.Readme"
                       "Distribution.Readme"
                       "FileList.Doc"
                                     )
             )
    )

		; Copy the Changes.Readme
		(if (IN prt3 0)
			(
				; The textfile
				(copyfiles (source "Install:Changes.Readme")
				           (dest asmonedir)
                   (infos)
        )

				; The .info file
				(copyfiles (source "Install:Changes.Readme.info")
				           (dest asmonedir)
                   (infos)
        )

			)
		)

		; Copy the Distribution.Readme
		(if (IN prt3 1)
			(
				; The textfile
				(copyfiles (source "Install:Distribution.Readme")
				           (dest asmonedir)
                   (infos)
        )

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

			)
		)

		; Copy the FileList.Doc
		(if (IN prt3 2)
			(
				; The textfile
				(copyfiles (source "Install:FileList.Doc")
				           (dest asmonedir)
                   (infos)
        )

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

			)
		)

		(set prt2 (askoptions (prompt #install-what2)
				     (help #install-what2-help)
				     (choices "ReqTools Package"
					      "Register Data (in S: Drawer)")
				     (default 1)
				)
		)

		; 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 0)
			(
				; 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 (#asmonedir-no-exist))
								(help (#asmonedir-no-exist-help))
								(default 0) )
							(
								(makedir target (infos) )
								(set goodresp TRUE)
							))
						)
						(
							(set goodresp TRUE)
					)
					)
				) )

				; Now extract the lha file directly to
				; the selected directory!
				; this is 'just' part 1 of the reqtools package.
				; the next part is located on disk 2!
				(set reqtoolsdir target)
				(set @default-dest target)

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

			)
		)

		; Copy REGSDATA ?
		(if (IN prt2 1)
			(
				(copyfiles (source "Install:Configuration/REGSDATA")
				(dest "S:")
				(infos)
			)
			)
		)

		; Now ask for disk 2!

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

		; Now: if the user selected reqtools, we still need to extract
		; the second & third archive.

		(if (IN prt2 0)
			(
				(
					(working "Working on extracting ReqTools archive.")
					(run ("Include1:C/lz x %s %s/" "Include1:ReqTools/REQTOOLS2.lha" target))
					(run ("Include1:C/lz x %s %s/" "Include1:ReqTools/REQTOOLS3.lha" target))
				)
			)
		)

		;***************************************************
		; Now: Disk 1 is finished, let's start with Disk 2!
		;***************************************************

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

		(set prt4 (askchoice (prompt #install-what4)
			        (help #install-what4-help)
			        (choices
                "Include/FD/Lib for OS1.3"
                "Include/FD/Lib for OS2.0"
                "Include/FD/Lib for OS3.0"
							))
		)

		; Users prefers OS 1.3 files. Now let's see what files he
		; wishes to install.
		(if (= prt4 0 )
			(
				(set prt5 (askoptions (prompt #install-what5-os13)
					         (help #install-what5-os13-help)
					         (choices
					           "Arp.Library"
				             "FD Files"
                     "Include Files"
                     "Library Files"
                     "_LVO Files"
                   )
			))

			; Ask for disk2 (just to be certain)!

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

			; Arp.Library
			(if (IN prt5 0)
				(
					; Note that the asmonedir/arp directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/fdp directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/include directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/libs directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/LVO directory is located inside
					; the LHA file.

					(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))
				)
			)

		)

		)

		; Users prefers OS 2.0 files. Now let's see what files he
		; wishes to install.
		(if (= prt4 1 )
			(
				(set prt5 (askoptions (prompt #install-what5-os20)
					         (help #install-what5-os20-help)
					         (choices
				             "FD Files"
                     "Include Files"
                     "Library Files"
                     "_LVO Files"
					           "Startup Files"
                   )
			))

			; Ask for disk2 (just to be certain)!

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

			; FD Files
			(if (IN prt5 0)
				(
					; Note that the asmonedir/fdp directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/include directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/libs directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/LVO directory is located inside
					; the LHA file.

					(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)
				(
					; Note that the asmonedir/Startups directory is located inside
					; the LHA file.

					(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))
					)
				)
			)
		)

		; Users prefers OS 3.0 files. Now let's see what files he
		; wishes to install.
		(if (= prt4 2 )
			(
				(set prt5 (askoptions (prompt #install-what5-os30)
					         (help #install-what5-os30-help)
					         (choices
				             "FD Files"
                     "Include Files"
                     "Library Files"
                     "_LVO Files"
					           "Startup Files"
				             "Documentation"
                   )
			))

			(if (IN prt5 4)
				(
					; Startup Code (2.0)
					; Ask for disk2 (just to be certain)!

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

					(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))

				)
			)

			;-------------------------------------
			; Disk 3 is needed (at least probably)
			;-------------------------------------

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

			; FD Files
			(if (IN prt5 0)
				(
					; Note that the asmonedir/fd directory is located inside
					; the LHA file.

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

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

			; Include Files
			(if (IN prt5 1)
				(
					; Note that the asmonedir/include directory is located inside
					; the LHA file.

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

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

			; Library Files
			(if (IN prt5 2)
				(
					; Note that the asmonedir/libs directory is located inside
					; the LHA file.

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

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

			; _LVO Files
			(if (IN prt5 3)
				(
					; Note that the asmonedir/LVO directory is located inside
					; the LHA file.

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

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

			; Now install documentation files.
			(if (IN prt5 5)
				(
					; Note that the asmonedir/Docs directory is located inside
					; the LHA file.

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

					(working "Working on extracting Startups archive.")
					(run ("Include2:C/lz x %s %s/" "Include2:Release3.0/Docs3.0.lha" target))
					)
				)
			)
		)

		; Now that we have disk 3 inserted (probably) we need to know
		; if the user wants to install some of the tools we supplied.

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

		(if (IN prt6 0)
			(
				; Just another check if disk3 (Include2:)
				; is inserted

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

				; Note that the asmonedir/tools directory is located inside
				; the LHA file

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

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

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

		(set prt7 (askoptions (prompt #install-what7)
		          (help #install-what7-help)
              (choices "AutoDocs OS 3.0 (V39)"
                       "Replay Routines")
              (default 2)
           )
    )

		(if (IN prt7 0)
			(
				; Just another check if disk4 (AddOns:)
				; is inserted

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

				; Note that the asmonedir/tools directory is located inside
				; the LHA file

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

					(working "Working on extracting AutoDocs archive.")
					(run ("AddOns:C/lz x %s %s/" "AddOns:Release3.0/AutoDocs3.lha" target))
			)
		)

		(if (IN prt7 1)
			(
				; Which directory?

				(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 "Work:Source/Replays")
						))

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

				(Copyfiles (source "AddOns:Replays/Future-Replay.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-CIAPlay.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)
				)


			)
		)

		; Now, let's ask the user if he wants to install
		; scrammer, enforcer and/or sushi.

		(set prt8 (askoptions (prompt #install-what8)
			                    (help #install-what8-help)
		                      (choices "Scrammer"
                                   "Enforcer V37.28"
                                   "Sushi V37.7")
				                  (default 0)
              )
    )

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

		; Install scrammer. Ask the user for a destination directory

		(if (IN prt8 0)
			(
				(set scrammerdir (getassign "Work" "v"))
				(if (= scrammerdir "") (set scrammerdir "sys:"))
				(set goodresp FALSE)
				(while (= goodresp FALSE)
				(
					(set target (askdir (prompt #which-disk-scrammer)
			                        (help #which-disk-scrammer-help)
                              (newpath)
                              (default "Work:Scrammer") ))

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

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

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

		; Install enforcer. Ask the user for a destination directory

		(if (IN prt8 1)
			(
				(set enforcerdir (getassign "Work" "v"))
				(if (= enforcerdir "") (set enforcerdir "sys:"))
				(set goodresp FALSE)
				(while (= goodresp FALSE)
				(
					(set target (askdir (prompt #which-disk-enforcer)
			                        (help #which-disk-enforcer-help)
                              (newpath)
                              (default "Work:Enforcer")
						))

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

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

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

		; Install Sushi. Ask the user for a destination directory

		(if (IN prt8 2)
			(
				(set sushidir (getassign "Work" "v"))
				(if (= sushidir "") (set sushidir "sys:"))
				(set goodresp FALSE)
				(while (= goodresp FALSE)
				(
					(set target (askdir (prompt #which-disk-sushi)
			                        (help #which-disk-sushi-help)
                              (newpath)
                              (default "Work:Sushi")
						))

						(if (not (exists target))
						(
							(if (askbool (prompt (#asmonedir-no-exist))
								(help (#asmonedir-no-exist-help))
								(default 0) )
							(
								(makedir target (infos) )
								(set goodresp TRUE)
							))
						)
						(
							(set goodresp TRUE)
						)
					)
				))
				(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)
				)
			)
		)

		; Copy Replay Routines ?

		; Make sure disk 4 (AddOns:) is inserted

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

		(set target asmonedir)
		(set @default-dest target)
	)
	(askbool (prompt #asmone-install-finished)
		           (choices "Proceed")
			         (default 0))

)
))
