;$VER: AsimCDFS Install 3.0 (1.6.95) 
;Copyright ©1993-1995 Asimware Innovations Inc.

(onerror (makeassign "AsimCDFSInst") )

(set #autoMount 1)
(set #CDDefault_NC "CD0" )
(set #isPioneer 0)
(set #PioneerSeparate 0)
(set #supportLUN 1)

(set #wbversion (getversion "libs:version.library"))
(set #wbversion (/ #wbversion 65536) )

(set #SCSIDevice "scsi.device")
(set #SCSIUnit 4)

(set @default-dest "SYS:AsimCDFS")
(set #echotxt "echo \"Mounting AsimCDFS...\"\n" )

(complete 0)


;  **********************************************************************
;  Need WB 2.0 or higher.
;  **********************************************************************
(if (< #wbversion 37)
	(abort "\n\nAmigaDOS 2.0 or higher is required for AsimCDFS 2.0. "
			 "\n\nAn upgrade will be needed for your Amiga."
			 "\n\nYou are currently running version " #wbversion ".")
)


;  **********************************************************************
;  Need lots of space on sys volume for devs and l
;  **********************************************************************
(if (< (getdiskspace "SYS:") 150000)
	(abort "\n\nApproximately 150K of disk space is needed on your SYS: volume."
			 "\n\nYou only have " (/ (getdiskspace "SYS:") 1024)	"K free.\n\n"
			 "Delete or transfer some files from the SYS: volume and try again." )
)


;  **********************************************************************
;  Lock our install disk
;  **********************************************************************
(askdisk
	(prompt "Please insert the disk labeled \"AsimCDFS_v3_Install\".")
	(help	"AsimCDFS FileSystem and other utilities will be copied "
			"from this disk into your system.")
	(dest  "AsimCDFS_v3_Install")
	(newname "AsimCDFSInst")
)


(set #theirlevel @user-level )
(user 2)

(complete 0 )
;  **********************************************************************
;  Ask if CDTV (1) , CD³² (2) or Amiga (0)
;  **********************************************************************
(set #IsAmiga
	(askchoice
		(prompt "\n\nAre you installing AsimCDFS on a CDTV/A570, a CD³² or an Amiga?" )
		(default 0 )
		(choices "Amiga" "CDTV/A570" "CD³²")
		(help "\n\nIf AsimCDFS is being used in conjunction with a CDTV/A570 unit "
				"then note this with the CDTV/A570 selection.\n\n"
				"If AsimCDFS is being used with a CD³² unit, then note this with the CD³² selection.\n\n"
				"Otherwise, you will be installing AsimCDFS on an Amiga equipped "
				"with a SCSI or IDE controller and SCSI or ATAPI CD-ROM drive." )
	)
)


(complete 5 )
;  **********************************************************************
;  Is CDTV
;  **********************************************************************
(if (= #IsAmiga 1) 
	((set #CDDefault_NC "CD1" )
	(set #SCSIDevice "cdtv.device")
	(set #SCSIUnit 0)
	)
)

;  **********************************************************************
;  Is CD³²
;  **********************************************************************
(if (= #IsAmiga 2) 
	((set #CDDefault_NC "CD1" )
	(set #SCSIDevice "cd.device")
	(set #SCSIUnit 0)
	)
)



;  **********************************************************************
;  If amiga, ask if using Pioneer or other
;  **********************************************************************
(if (= #IsAmiga 0)
	(set #isPioneer 
		(askbool
			(prompt "\n\n\nIs your CD-ROM drive a Pioneer DRM-60x?" )
			(default 0)
			(choices "Pioneer DRM-60x" "Other CD-ROM")
			(help "\n\nIf you are using AsimCDFS with a Pioneer DRM-60x, indicate this "
					"in your choice.  This drive is a high-performance 6-disc minichanger and "
					"is not common."
					"\n\nOtherwise select Other CD-ROM." )
		)
	)
)


(complete 10 )
(if #isPioneer
	(
	;  **********************************************************************
	;  ask if pioneer is separate or pooled
	;  **********************************************************************
	(set #PioneerSeparate
			(askbool
				(prompt "\n\nDo you wish to have 6 separate devices mounted, or would you like all 6 discs pooled into 1 device?\n\n" )
				(default 0 )
				(choices "Separate" "Pooled")
				(help "\n\nIf you wish to have access to all 6 discs simultaneously, then "
						"select Separate, otherwise select Pooled  --  in the latter case, "
						"you can switch between the discs with DiscChanger." )
			)
		)

	;  **********************************************************************
	;  If pioneer separate, ask for base name
	;  **********************************************************************
	(if #PioneerSeparate
		((set #CDDevice_NC 
				(askstring
					(prompt "\n\nWhat is the base-name for the AmigaDOS device?\n\n(The trailing colon MUST NOT be present.  See manual for explanation.)" )
					(default "CD" )
					(help "\n\nThis is the base name under which AmigaDOS will reference the "
							"CD-ROM as.  As you are installing AsimCDFS for a Pioneer 6-disc changer "
							", 6 such devices named <basename>0 through <basename>5 will be mounted (ie.  CD0, CD1, ..., CD5) "
							"\n\nThe trailing : (colon) or the 0 through 5 MUST NOT be present." )
				)
			)
		(set #CDDevice (cat #CDDevice_NC "0:")))
		)
	)
)




;  **********************************************************************
;  If pioneer pooled or other CD-ROM, ask for CD0 device alternate
;  **********************************************************************
(if (not #PioneerSeparate)
	((set #CDDevice_NC 
		(askstring
			(prompt "\n\nWhat is the name for the AmigaDOS device?\n\n(The trailing colon MUST NOT be present)" )
			(default #CDDefault_NC )
			(help "\n\nThis is the name under which AmigaDOS will reference the "
					"CD-ROM as.  While usually "
					#CDDefault_NC
					", it can be any name you choose. "
					"\n\nThe trailing : (colon) MUST NOT be present." )
		)
	)

	(set #CDDevice (cat #CDDevice_NC ":") ))
)



;  **********************************************************************
;  Ask to run SCSI Inquire
;  **********************************************************************
(if (= #IsAmiga 0)
	(set #useInquire
		(askbool
			(prompt "\n\nWould you like to use the SCSI Inquire utility to locate your CD-ROM drive?" )
			(default 1 )
			(help "\n\nThe SCSI Inquire utility will scan your system for suitable SCSI "
					"or ATAPI devices and display a listing of all units connected to the device.  "
					"Your CD-ROM drive must be powered-on and correctly connected "
					"for it to be acknowledged by this utility.  Consult the SCSI Inquire "
					"chapter for more information." )
		)
	)
)


;  **********************************************************************
;  Run SCSI Inquire
;  **********************************************************************
(if #useInquire
	(
	(run "AsimCDFS_v3_Install:SCSI_Inquire")	
	
	(if (exists "ENV:SCSI_Device")
		((set #SCSIDevice (getenv "SCSI_Device"))
		(set #SCSIUnit (+ (getenv "SCSI_Unit")))
		))
	)
)



(complete 15 )
(if (= #IsAmiga 0)
	;  **********************************************************************
	;  Ask for device name
	;  **********************************************************************
	((set #SCSIDevice 
		(askstring
			(prompt "\n\nWhat is the name of your SCSI or ATAPI device?" )
			(default #SCSIDevice )
			(help "\n\nThis is the name of the device driver for your particular "
					"SCSI card.  For example, the Commodore 2091/590/Amiga3000 has "
					"a name of \"scsi.device\" while our ATAPI driver has a name of \"asim_ide.device\".\n\n"
					"If you successfully ran the SCSI Inquire utility, this question will default to the correct unit number. "
					"Otherwise, consult either the AsimCDFS User's Guide or contact the controller card manufacturer." )
		)
	)
	
	(complete 18 )
	;  **********************************************************************
	;  Ask for unit number
	;  **********************************************************************
	(set #SCSIUnit 
		(asknumber
			(prompt "\n\nWhat is the unit number of your CD-ROM drive?" )
			(default #SCSIUnit )
			(help "\n\nThis is the unit # of the CD-ROM drive.  This is usually a "
					"numerical value between 0 and 6 for SCSI units and between 0 and 1 for ATAPI units.\n\n"
					"If you successfully ran the SCSI Inquire utility, this question will default to the correct unit number.  "
					"Otherwise, consult the CD-ROM drive documentation for instructions on "
					"determining the unit #." )
		)
	))
)


;  **********************************************************************
;  Ask for automount?
;  **********************************************************************
(complete 35 )
(set #autoMount
	(askbool
		(prompt "\n\nWould you like the CD-ROM drive automatically mounted upon bootup?" )
		(help "\n\nIf you would like, the appropriate commands will be added to your user-startup file to automatically mount AsimCDFS.\n")
		(default 1)
	)
)

(set #mountDirectory "sys:storage/DOSDrivers/")





;  **********************************************************************
;  Ask for AsimCDFS:
;  **********************************************************************
(set #tunesDir
	(askdir
		(prompt "Specify the directory in which the AsimCDFS support programs will be placed:" )
		(help "AsimCDFS contains a number of support programs.  This directory will specifiy where the programs will be placed.  If you need, create a separate directory for the files.")
		(default @default-dest)
		(newpath)
	)
)

(if (not (exists #tunesDir (noreq)))
	(makedir #tunesDir
		(prompt "Creating the AsimCDFS: directory...")
		(help "This will create the specified directory for the support programs.")
		(infos)
		)
)
(makeassign "AsimCDFS" #tunesDir)




;  **********************************************************************
;  Ask for AsimCDFS_Buffer:
;  **********************************************************************
(set #bufferDir "Work:AsimCDFS_Buffer")
(run "AsimCDFS_v3_Install:c/MostFree")	
	
(if (exists "ENV:MostFree")
	(set #bufferDir (cat (getenv "MostFree") "AsimCDFS_Buffer"))
)

(set #bufferDir
	(askdir
		(prompt "Specify the directory which can be used for buffering AsimCDFS files:" )
		(help "AsimCDFS will require a directory in which it will buffer "
				"various files, including PhotoCD thumbnail icons, snapshot icon files "
				"and audio library files.  As the number of files in this directory "
				"may grow as your CD-ROM collection expands, it is "
				"advisable to put this directory on a large hard drive partition." )
		(default #bufferDir )
		(newpath)
	)
)

(if (not (exists #bufferDir (noreq)))
	(makedir #bufferDir
		(prompt "Creating the AsimCDFS_Buffer: directory...")
		(help "This will create the specified directory for the buffered files.")
		(infos)
		)
)
(makeassign "AsimCDFS_Buffer" #bufferDir)
(user #theirlevel)


(set n 0)
(while
	(set #buffsubdir 
		(select n "AsimCDFS_Buffer:PhotoCDIcon_Buffer"
					 "AsimCDFS_Buffer:Audio"
					 "AsimCDFS_Buffer:Raw"
					 "AsimCDFS_Buffer:Marks"
					 "AsimCDFS_Buffer:NonVolatile"
			       ""
			)
		)
	(
	(if (not (exists #buffsubdir (noreq)))
		(makedir #buffsubdir
			(prompt "Creating the " #buffsubdir " directory...")
			(help "This will create the specified directory for the buffered files.")
			(infos)
			)
	)

	(set n (+ n 1))
	)
)



;  **********************************************************************
;  delete obsolete files
;  **********************************************************************
;  Delete old AsimPhoto, if present in AsimCDFS dir.
;  all other files are either the user's or will be over written
(if (exists "AsimCDFS:AsimPhoto")
	((delete "AsimCDFS:AsimPhoto"
		(prompt "\n\Deleting obsolete AsimPhoto.\n" )
		(confirm)
		(help "\n\nThis will delete the old AsimPhoto program, which is "
			"no longer required for AsimCDFS v3.x\n" )
		)
	)
)		


(if (exists "AsimCDFS:AsimPhoto.info")
	((delete "AsimCDFS:AsimPhoto.info"
		(prompt "\n\Deleting obsolete AsimPhoto.info.\n" )
		(confirm)
		(help "\n\nThis will delete the old AsimPhoto icon, which is "
			"no longer required for AsimCDFS v3.x\n" )
		)
	)
)		

(if (exists "ENVARC:AsimCDFS/Photo.info")
	((delete "ENVARC:AsimCDFS/Photo.info"
		(prompt "\n\Deleting obsolete default Photo icon.\n" )
		(confirm)
		(help "\n\nThis will delete the old default Photo icon, which is "
			"no longer required for AsimCDFS v3.x\n" )
		)
	)
)		




(if (exists "ENVARC:AsimCDFS/DiscChanger.prefs")
	((delete "ENVARC:AsimCDFS/DiscChanger.prefs"
		(prompt "\n\Deleting obsolete DiscChanger preferences file.\n" )
		(confirm)
		(help "\n\nThis will delete the old DiscChanger preferences file, which is "
			"no longer required for AsimCDFS v3.x\n" )
		)
	)
)		

(if (exists "ENVARC:AsimCDFS/AsimTunes.prefs")
	((delete "ENVARC:AsimCDFS/AsimTunes.prefs"
		(prompt "\n\Deleting obsolete AsimTunes preferences file.\n" )
		(confirm)
		(help "\n\nThis will delete the old AsimTunes preferences file, which is "
			"no longer required for AsimCDFS v3.x\n" )
		)
	)
)		


(if (exists "ENVARC:AsimCDFS/AsimPhoto.prefs")
	((delete "ENVARC:AsimCDFS/AsimPhoto.prefs"
		(prompt "\n\Deleting obsolete AsimPhoto preferences file.\n" )
		(confirm)
		(help "\n\nThis will delete the old AsimPhoto preferences file, which is "
			"no longer required for AsimCDFS v3.x\n" )
		)
	)
)		



;  **********************************************************************
;  l:AsimCDFS
;  **********************************************************************
(complete 30 )
(protect "l:AsimCDFS" "rwed" )
(copyfiles
	(prompt "\n\nCopying AsimCDFS FileSystem to the l: directory.\n" )
	(source "AsimCDFSInst:l/AsimCDFS")
	(dest "l:")
	(confirm)
	(help "\n\nThis will copy over the AsimCDFS FileSystem program to your "
		"l: directory\n\nThis is an essential step in the installation "
		"process.\n" )
)



;  **********************************************************************
;  devs:asimcdfs.device
;  **********************************************************************
(complete 30 )
(protect "devs:asimcdfs.device" "rwed" )
(copyfiles
	(prompt "\n\nCopying asimcdfs.device to the devs: directory.\n" )
	(source "AsimCDFSInst:devs/asimcdfs.device")
	(dest "devs:")
	(confirm)
	(help "\n\nThis will copy over the asimcdfs.device program to your "
		"devs: directory\n\nThis is an essential step in the installation "
		"process.\n" )
)





;  **********************************************************************
;  Create mountlists and alter user-startup
;  **********************************************************************
(if (= #wbversion 37) 
	((if #PioneerSeparate
		((set #startupCommand1 (cat "mount >NIL: " #CDDevice_NC "0: from devs:MountList." #CDDevice_NC "\n") )
		(set #startupCommand2 (cat "mount >NIL: " #CDDevice_NC "1: from devs:MountList." #CDDevice_NC "\n") )
		(set #startupCommand3 (cat "mount >NIL: " #CDDevice_NC "2: from devs:MountList." #CDDevice_NC "\n") )
		(set #startupCommand4 (cat "mount >NIL: " #CDDevice_NC "3: from devs:MountList." #CDDevice_NC "\n") )
		(set #startupCommand5 (cat "mount >NIL: " #CDDevice_NC "4: from devs:MountList." #CDDevice_NC "\n") )
		(set #startupCommand6 (cat "mount >NIL: " #CDDevice_NC "5: from devs:MountList." #CDDevice_NC "\n") )
		(set #startupWait "wait sec=4\n" )
		
		(if #autoMount
			((protect "S:User-Startup" "rwed" )
			(protect "S:Startup-Sequence" "rwed" )
			
			(startup "AsimCDFS"
				(command #echotxt)
				(command (cat "assign AsimCDFS: \"" #tunesDir "\"\n"))
				(command (cat "assign AsimCDFS_Buffer: \"" #bufferDir "\"\n"))
				(command #startupCommand1 )
				(command #startupCommand2 )
				(command #startupCommand3 )
				(command #startupCommand4 )
				(command #startupCommand5 )
				(command #startupCommand6 )
				(prompt "Inserting MOUNT commands into the startup-sequence")
				(help "\n\nThe command \"MOUNT " #CDDevice " FROM DEVS:MOUNTLIST." #CDDevice_NC "\" is being inserted into your "
						"\"S:Startup-Sequence\" or \"S:User-Startup\" file to "
						"automatically start AsimCDFS upon bootup." )
			))
		))
	)

	(if (not #PioneerSeparate)
		((set #startupCommand (cat "mount >NIL: " #CDDevice " from devs:MountList." #CDDevice_NC "\n") )
		(if #autoMount
			((protect "S:User-Startup" "rwed" )
			(protect "S:Startup-Sequence" "rwed" )
			
			(startup "AsimCDFS"
				(command #echotxt)
				(command (cat "assign AsimCDFS: \"" #tunesDir "\"\n"))
				(command (cat "assign AsimCDFS_Buffer: \"" #bufferDir "\"\n"))
				(command #startupCommand )
				(prompt "Inserting MOUNT command into the startup-sequence")
				(help "\n\nThe command \"MOUNT " #CDDevice " FROM DEVS:MOUNTLIST." #CDDevice_NC "\" is being inserted into your "
						"\"S:Startup-Sequence\" or \"S:User-Startup\" file to "
						"automatically start AsimCDFS upon bootup." )
			))
		))
	)
	
	(if (not #autoMount)
		((protect "S:User-Startup" "rwed" )
		(protect "S:Startup-Sequence" "rwed" )
		
		(startup "AsimCDFS"
			(command (cat "assign AsimCDFS: \"" #tunesDir "\"\n"))
			(command (cat "assign AsimCDFS_Buffer: \"" #bufferDir "\"\n"))
			(prompt "Inserting MOUNT command into the startup-sequence")
			(help "\n\nThe command \"MOUNT " #CDDevice " FROM DEVS:MOUNTLIST." #CDDevice_NC "\" is being inserted into your "
					"\"S:Startup-Sequence\" or \"S:User-Startup\" file to "
					"automatically start AsimCDFS upon bootup." )
		))
	)

	(protect (cat "devs:MountList." #CDDevice_NC) "rwed" )

	(if #isPioneer
		(textfile
			(dest (cat "devs:MountList." #CDDevice_NC) )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append #CDDevice_NC "0:\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 0" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Mount          = 1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
			(append "#\n\n")
			(append #CDDevice_NC "1:\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 1" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Mount          = 1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
			(append "#\n\n")
			(append #CDDevice_NC "2:\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 2" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Mount          = 1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
			(append "#\n\n")
			(append #CDDevice_NC "3:\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 3" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Mount          = 1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
			(append "#\n\n")
			(append #CDDevice_NC "4:\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 4" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Mount          = 1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
			(append "#\n\n")
			(append #CDDevice_NC "5:\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 5" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Mount          = 1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
			(append "#\n\n")
		)
	)



	(if (not #isPioneer)
		(textfile
			(dest (cat "devs:MountList." #CDDevice_NC) )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append #CDDevice "\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = " #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Mount          = " #autoMount "\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
			(append "#\n")
		)
	))
)



(if (> #wbversion 37) 
	((if (not #PioneerSeparate)
		((textfile
			(dest (cat #mountDirectory #CDDevice_NC) )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = " #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Mount          = 1\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
		)

		(copyfiles
				(prompt "\n\nCopying Mountlist icon")
				(source "AsimCDFSInst:Storage/DOSDrivers/CD0.info")
				(dest #mountDirectory)
				(newname (cat #CDDevice_NC ".info"))
				(help "\n\nThis will copy over an icon for the mountlist file.")
				(confirm)
			)		

	))


	(if #PioneerSeparate
		((textfile
			(dest (cat #mountDirectory #CDDevice_NC "0") )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 0" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Mount          = 1\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
		)

		(copyfiles
				(prompt "\n\nCopying Mountlist icon")
				(source "AsimCDFSInst:Storage/DOSDrivers/CD0.info")
				(dest #mountDirectory)
				(newname (cat #CDDevice_NC "0.info"))
				(help "\n\nThis will copy over an icon for the mountlist file.")
				(confirm)
			)
		
		(textfile
			(dest (cat #mountDirectory #CDDevice_NC "1") )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 1" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Mount          = 1\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
		)

		(copyfiles
				(prompt "\n\nCopying Mountlist icon")
				(source "AsimCDFSInst:Storage/DOSDrivers/CD0.info")
				(dest #mountDirectory)
				(newname (cat #CDDevice_NC "1.info"))
				(help "\n\nThis will copy over an icon for the mountlist file.")
				(confirm)
			)

		(textfile
			(dest (cat #mountDirectory #CDDevice_NC "2") )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 2" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Mount          = 1\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
		)
		

		(copyfiles
				(prompt "\n\nCopying Mountlist icon")
				(source "AsimCDFSInst:Storage/DOSDrivers/CD0.info")
				(dest #mountDirectory)
				(newname (cat #CDDevice_NC "2.info"))
				(help "\n\nThis will copy over an icon for the mountlist file.")
				(confirm)
			)

		(textfile
			(dest (cat #mountDirectory #CDDevice_NC "3") )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 3" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Mount          = 1\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
		)
		
		(copyfiles
				(prompt "\n\nCopying Mountlist icon")
				(source "AsimCDFSInst:Storage/DOSDrivers/CD0.info")
				(dest #mountDirectory)
				(newname (cat #CDDevice_NC "3.info"))
				(help "\n\nThis will copy over an icon for the mountlist file.")
				(confirm)
			)

		(textfile
			(dest (cat #mountDirectory #CDDevice_NC "4") )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 4" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Mount          = 1\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
		)

		(copyfiles
				(prompt "\n\nCopying Mountlist icon")
				(source "AsimCDFSInst:Storage/DOSDrivers/CD0.info")
				(dest #mountDirectory)
				(newname (cat #CDDevice_NC "4.info"))
				(help "\n\nThis will copy over an icon for the mountlist file.")
				(confirm)
			)

		(textfile
			(dest (cat #mountDirectory #CDDevice_NC "5") )
			(append "/************************************************************************/\n"
					  "/*  AsimCDFS v3 MountList entry -- ©1993-1995 Asimware Innovations Inc. */\n"
					  "/************************************************************************/\n")
			(append "	Device         = " #SCSIDevice "\n" )
			(append "	Unit           = 5" #SCSIUnit "\n" )
			(append "	Buffers        = 0\n")
			(append "	BufMemType     = 5\n" )
			(append "	Mask           = 0xffffffe\n" )
			(append "	Flags          = 0\n" )
			(append "	FileSystem     = l:AsimCDFS\n")
			(append "	DosType        = 0x662dabac\n")
			(append "	GlobVec        = -1\n")
			(append "	Reserved       = 0\n")
			(append "	LowCyl         = 0\n")
			(append "	HighCyl        = 999\n")
			(append "	Mount          = 1\n")
			(append "	Surfaces       = 1\n")
			(append "	BlocksPerTrack = 32\n")
			(append "	Priority       = 10\n")
			(append "	StackSize      = 5000\n")
		)
		(copyfiles
				(prompt "\n\nCopying Mountlist icon")
				(source "AsimCDFSInst:Storage/DOSDrivers/CD0.info")
				(dest #mountDirectory)
				(newname (cat #CDDevice_NC "5.info"))
				(help "\n\nThis will copy over an icon for the mountlist file.")
				(confirm)
			)
	))


	(protect "S:User-Startup" "rwed" )
	(protect "S:Startup-Sequence" "rwed" )

	(if (not #autoMount)
		(startup "AsimCDFS"
			(command (cat "assign AsimCDFS: \"" #tunesDir "\"\n"))
			(command (cat "assign AsimCDFS_Buffer: \"" #bufferDir "\"\n"))
			(prompt "Inserting Assign command into the startup-sequence")
			(help "\n\nThe command assign AsimCDFS: and assign AsimCDFS_Buffer are being entered into your s:user-startup file.")
			)
		)

	(if #autoMount
		((if #PioneerSeparate
			(startup "AsimCDFS"
				(command #echotxt)
				(command (cat "assign AsimCDFS: \"" #tunesDir "\"\n"))
				(command (cat "assign AsimCDFS_Buffer: \"" #bufferDir "\"\n"))
				(command (cat "mount >NIL: " #CDDevice_NC "0:\n") )
				(command (cat "mount >NIL: " #CDDevice_NC "1:\n") )
				(command (cat "mount >NIL: " #CDDevice_NC "2:\n") )
				(command (cat "mount >NIL: " #CDDevice_NC "3:\n") )
				(command (cat "mount >NIL: " #CDDevice_NC "4:\n") )
				(command (cat "mount >NIL: " #CDDevice_NC "5:\n") )
				(prompt "Inserting Assign command into the startup-sequence")
				(help "\n\nThe command assign AsimCDFS: and assign AsimCDFS_Buffer are being entered into your s:user-startup file.")
				)
			)
			
		(if (not #PioneerSeparate)
			(startup "AsimCDFS"
				(command #echotxt)
				(command (cat "assign AsimCDFS: \"" #tunesDir "\"\n"))
				(command (cat "assign AsimCDFS_Buffer: \"" #bufferDir "\"\n"))
				(command (cat "mount >NIL: " #CDDevice "\n") )
				(prompt "Inserting Assign command into the startup-sequence")
				(help "\n\nThe command assign AsimCDFS: and assign AsimCDFS_Buffer are being entered into your s:user-startup file.")
				)
			)			
		)
	)
))


;  **********************************************************************
;  Delete old mountlists is DEVS:DosDrivers/
;  **********************************************************************
(if (> #wbversion 37) 
	((if (not #PioneerSeparate)
		((if (exists (cat "DEVS:DosDrivers/" #CDDevice_NC))
			((delete (cat "DEVS:DosDrivers/" #CDDevice_NC)
			(prompt "\n\Deleting obsolete MountList file from DEVS:DosDrivers/\n" )
			(confirm)
			(help "\n\nThis will delete the obsolete MountList file from the DEVS:DosDrivers/ directory.  "
					"MountList files for AsimCDFS v3.x are now put into the SYS:Storage/DOSDrivers directory.\n" )
				)

			(delete (cat "DEVS:DosDrivers/" #CDDevice_NC ".info")
			(prompt "\n\Deleting obsolete MountList file from DEVS:DosDrivers/\n" )
			(confirm)
			(help "\n\nThis will delete the obsolete MountList file from the DEVS:DosDrivers/ directory.  "
					"MountList files for AsimCDFS v3.x are now put into the SYS:Storage/DOSDrivers directory.\n" )
				)
			)
		))
	))

	(if #PioneerSeparate
		((set n 0)
		(while
			(set #oldml
				(select n (cat "DEVS:DosDrivers/" #CDDevice_NC "0")
							 (cat "DEVS:DosDrivers/" #CDDevice_NC "1")
							 (cat "DEVS:DosDrivers/" #CDDevice_NC "2")
							 (cat "DEVS:DosDrivers/" #CDDevice_NC "3")
							 (cat "DEVS:DosDrivers/" #CDDevice_NC "4")
							 (cat "DEVS:DosDrivers/" #CDDevice_NC "5")
					       ""
					)
				)
				
			(if (exists #oldml)
				((delete #oldml
				(prompt "\n\Deleting obsolete MountList file from DEVS:DosDrivers/\n" )
				(confirm)
				(help "\n\nThis will delete the obsolete MountList file from the DEVS:DosDrivers/ directory.  "
						"MountList files for AsimCDFS v3.x are now put into the SYS:Storage/DOSDrivers directory.\n" )
					)


				(delete (cat #oldml ".info")
				(prompt "\n\Deleting obsolete MountList file from DEVS:DosDrivers/\n" )
				(confirm)
				(help "\n\nThis will delete the obsolete MountList file from the DEVS:DosDrivers/ directory.  "
						"MountList files for AsimCDFS v3.x are now put into the SYS:Storage/DOSDrivers directory.\n" )
					)
				)
			)		
			)
		)
))

;  **********************************************************************
;  Default prefs files
;  **********************************************************************
(if (= #IsAmiga 0)
	((if #isPioneer
		;  **********************************************************************
		;  Default prefs file for a Pioneer drive, separate
		;  **********************************************************************
		((if #PioneerSeparate
			((copyfiles
				(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
				(source "AsimCDFSInst:Default_Prefs/Pioneer_Separate")
				(dest "ENVArc:AsimCDFS")
				(newname (cat #CDDevice_NC "0"))
				(help "\n\nThis will copy over a default preferences file.")
				(confirm)
			)
	
			(copyfiles
				(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
				(source "AsimCDFSInst:Default_Prefs/Pioneer_Separate")
				(dest "ENVArc:AsimCDFS")
				(newname (cat #CDDevice_NC "1"))
				(help "\n\nThis will copy over a default preferences file.")
				(confirm)
			)
	
			(copyfiles
				(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
				(source "AsimCDFSInst:Default_Prefs/Pioneer_Separate")
				(dest "ENVArc:AsimCDFS")
				(newname (cat #CDDevice_NC "2"))
				(help "\n\nThis will copy over a default preferences file.")
				(confirm)
			)
	
			(copyfiles
				(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
				(source "AsimCDFSInst:Default_Prefs/Pioneer_Separate")
				(dest "ENVArc:AsimCDFS")
				(newname (cat #CDDevice_NC "3"))
				(help "\n\nThis will copy over a default preferences file.")
				(confirm)
			)
	
			(copyfiles
				(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
				(source "AsimCDFSInst:Default_Prefs/Pioneer_Separate")
				(dest "ENVArc:AsimCDFS")
				(newname (cat #CDDevice_NC "4"))
				(help "\n\nThis will copy over a default preferences file.")
				(confirm)
			)
	
			(copyfiles
				(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
				(source "AsimCDFSInst:Default_Prefs/Pioneer_Separate")
				(dest "ENVArc:AsimCDFS")
				(newname (cat #CDDevice_NC "5"))
				(help "\n\nThis will copy over a default preferences file.")
				(confirm)
			))
		)
			
		;  **********************************************************************
		;  Default prefs file for a Pioneer drive, pooled
		;  **********************************************************************
		(if (not #PioneerSeparate)
			(copyfiles
				(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
				(source "AsimCDFSInst:Default_Prefs/Pioneer_Pool")
				(dest "ENVArc:AsimCDFS")
				(newname #CDDevice_NC)
				(help "\n\nThis will copy over a default preferences file.")
				(confirm)
			)
		)		
	))
	
	
	;  **********************************************************************
	;  Default prefs file for a SCSI or ATAPI CD-ROM drive
	;  **********************************************************************
	(if (not #isPioneer)
		(copyfiles
			(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
			(source "AsimCDFSInst:Default_Prefs/Default")
			(dest "ENVArc:AsimCDFS")
			(newname #CDDevice_NC)
			(help "\n\nThis will copy over a default preferences file.")
			(confirm)
		)
	))
)




;  **********************************************************************
;  Default prefs file for a CDTV
;  **********************************************************************
(if (= #IsAmiga 1)
	(copyfiles
		(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
		(source "AsimCDFSInst:Default_Prefs/CDTV")
		(dest "ENVArc:AsimCDFS")
		(newname #CDDevice_NC)
		(help "\n\nThis will copy over a default preferences file.")
		(confirm)
	)
)


;  **********************************************************************
;  Default prefs file for a CD³²
;  **********************************************************************
(if (= #IsAmiga 2)
	(copyfiles
		(prompt "\n\nCopying default preferences file to the ENVArc:AsimCDFS directory.\n" )
		(source "AsimCDFSInst:Default_Prefs/CD³²")
		(dest "ENVArc:AsimCDFS")
		(newname #CDDevice_NC)
		(help "\n\nThis will copy over a default preferences file.")
		(confirm)
	)
)

(complete 60 )







;  **********************************************************************
;  AsimTunes
;  **********************************************************************
(set #instTunes
	(askbool
		(prompt "\n\nShould the AsimTunes utility be installed?")
		(help "\n\nThis will copy over the AsimTunes utility "
				"to your AsimCDFS: directory\n\nIf you do not "
				"wish the AsimTunes program to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(if #instTunes 
	((protect "AsimCDFS:AsimTunes" "rwed" )
	(protect "AsimCDFS:AsimTunes.info" "rwed" )
	(copyfiles
		(prompt "\n\nCopying AsimTunes audio CD controller program to the "
				  "AsimCDFS: directory.\n" )
		(source "AsimCDFSInst:AsimTunes")
		(dest "AsimCDFS:")
		(infos)
		(noposition)
		(help "\n\nThis will copy over the AsimTunes audio CD controller "
				"program to your AsimCDFS: directory\n\nIf you do not "
				"wish the AsimTunes program to be transferred to your system, "
				"skip this step.\n" )
		(confirm)
	)
	
	(tooltype
		(dest "AsimCDFS:AsimTunes" )
		(settooltype "CDROM" #CDDevice )
		(noposition)
	)
		
		
	(complete 70 )
	(protect "fonts:AsimTunes2" "rwed" )
	(protect "fonts:AsimTunes2.font" "rwed" )
	(protect "fonts:AsimTunes2/11" "rwed" )
	(protect "fonts:AsimTunes2/20" "rwed" )
	(copyfiles
		(prompt "\n\nCopying AsimTunes fonts to the FONTS: directory\n" )
		(source "AsimCDFSInst:fonts")
		(dest "fonts:" )
		(all)
		(help "\n\nThis will copy over the fonts needed for AsimTunes.\n\n"
				"They will be placed into your fonts: directory.\n\n" )
		(confirm) )
))





;  **********************************************************************
;  DiscChanger
;  **********************************************************************
(complete 80 )

(set #instChanger
	(askbool
		(prompt "\n\nShould the DiscChanger utility be installed?")
		(help "\n\nThis will copy over the DiscChanger utility "
				"to your AsimCDFS: directory\n\nIf you do not "
				"wish the DiscChanger program to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(complete 85 )
(if #instChanger
	((protect "AsimCDFS:DiscChanger" "rwed" )
	(copyfiles
		(prompt "\n\nCopying the DiscChanger utility to the AsimCDFS: "
				  "directory.\n" )
		(source "AsimCDFSInst:DiscChanger")
		(dest "AsimCDFS:")
		(infos)
		(noposition)
		(help "\n\nThis will copy over the DiscChanger utility "
				"program to your AsimCDFS: directory\n\nIf you do not "
				"wish the DiscChanger program to be transferred to your system, "
				"skip this step.\n" )
		(confirm)
	)
	
	(tooltype
		(dest "AsimCDFS:DiscChanger" )
		(settooltype "CDROM" #CDDevice )
		(noposition)
	)
))





;  **********************************************************************
;  AsimCDFS_Prefs
;  **********************************************************************
(complete 80 )
(set #instPrefs
	(askbool
		(prompt "\n\nShould the AsimCDFS_Prefs utility be installed?")
		(help "\n\nThis will copy over the AsimCDFS_Prefs utility "
				"to your AsimCDFS: directory\n\nIf you do not "
				"wish the AsimCDFS_Prefs program to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(complete 85 )
(if #instPrefs
	((protect "AsimCDFS:AsimCDFS_Prefs" "rwed" )
	(copyfiles
		(prompt "\n\nCopying the AsimCDFS_Prefs utility to the AsimCDFS: "
				  "directory.\n" )
		(source "AsimCDFSInst:AsimCDFS_Prefs")
		(dest "AsimCDFS:")
		(infos)
		(noposition)
		(help "\n\nThis will copy over the AsimCDFS_Prefs utility "
				"program to your AsimCDFS: directory\n\nIf you do not "
				"wish the AsimCDFS_Prefs program to be transferred to your system, "
				"skip this step.\n" )
		(confirm)
	)
))




;  **********************************************************************
;  SimBoot
;  **********************************************************************
(complete 80 )
(set #instSimBoot
	(askbool
		(prompt "\n\nShould the SimBoot utility be installed?")
		(help "\n\nThis will copy over the SimBoot utility "
				"to your AsimCDFS: directory\n\nIf you do not "
				"wish the SimBoot program to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(complete 85 )
(if #instSimBoot
	((protect "AsimCDFS:SimBoot" "rwed" )
	(copyfiles
		(prompt "\n\nCopying the SimBoot utility to the AsimCDFS: "
				  "directory.\n" )
		(source "AsimCDFSInst:SimBoot")
		(dest "AsimCDFS:")
		(infos)
		(noposition)
		(help "\n\nThis will copy over the SimBoot utility "
				"program to your AsimCDFS: directory\n\nIf you do not "
				"wish the SimBoot program to be transferred to your system, "
				"skip this step.\n" )
		(confirm)
	)

))



;  **********************************************************************
;  CD³²_Prefs
;  **********************************************************************
(complete 80 )
(set #instCD32Prefs
	(askbool
		(prompt "\n\nShould the CD³²_Prefs utility be installed?")
		(help "\n\nThis will copy over the CD³²_Prefs utility "
				"to your AsimCDFS: directory\n\nIf you do not "
				"wish the CD³²_Prefs program to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(complete 85 )
(if #instCD32Prefs
	((protect "AsimCDFS:CD³²_Prefs" "rwed" )
	(copyfiles
		(prompt "\n\nCopying the CD³²_Prefs utility to the AsimCDFS: "
				  "directory.\n" )
		(source "AsimCDFSInst:CD³²_Prefs")
		(dest "AsimCDFS:")
		(infos)
		(noposition)
		(help "\n\nThis will copy over the CD³²_Prefs utility "
				"program to your AsimCDFS: directory\n\nIf you do not "
				"wish the CD³²_Prefs program to be transferred to your system, "
				"skip this step.\n" )
		(confirm)
	)

))




;  **********************************************************************
;  CDTV Prefs
;  **********************************************************************
(complete 80 )
(set #instCDTVPrefs
	(askbool
		(prompt "\n\nShould the CDTV_Prefs utility be installed?")
		(help "\n\nThis will copy over the CDTV_Prefs utility "
				"to your AsimCDFS: directory\n\nIf you do not "
				"wish the CDTV_Prefs program to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(complete 85 )
(if #instCDTVPrefs
	((protect "AsimCDFS:CDTV_Prefs" "rwed" )
	(copyfiles
		(prompt "\n\nCopying the CDTV_Prefs utility to the AsimCDFS: "
				  "directory.\n" )
		(source "AsimCDFSInst:CDTV_Prefs")
		(dest "AsimCDFS:")
		(infos)
		(noposition)
		(help "\n\nThis will copy over the CDTV_Prefs utility "
				"program to your AsimCDFS: directory\n\nIf you do not "
				"wish the CDTV_Prefs program to be transferred to your system, "
				"skip this step.\n" )
		(confirm)
	)

))







(complete 80 )
(set #instCDTVEmul
	(askbool
		(prompt "\n\nShould the CDTV emulation option be installed?")
		(help "\n\nThis will copy over the required files for the "
				"CDTV emulation:\n   devs:cdtv.device\n   devs:bookmark.device\n   devs:cardmark.device\n   libs:playerprefs.library\n\nIf you do not "
				"wish the CDTV emulation option to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(complete 85 )
(if #instCDTVEmul
	((complete 30 )
	;  **********************************************************************
	;  devs:cdtv.device
	;  **********************************************************************
	(protect "devs:cdtv.device" "rwed" )
	(copyfiles
		(prompt "\n\nCopying cdtv.device to the devs: directory.\n" )
		(source "AsimCDFSInst:devs/cdtv.device")
		(dest "devs:")
		(confirm)
		(help "\n\nThis will copy over the cdtv.device program to your "
			"devs: directory\n\nThis is part of the CDTV emulation\n" )
	)
	
	
	
	;  **********************************************************************
	;  devs:bookmark.device
	;  **********************************************************************
	(complete 30 )
	(protect "devs:bookmark.device" "rwed" )
	(copyfiles
		(prompt "\n\nCopying bookmark.device to the devs: directory.\n" )
		(source "AsimCDFSInst:devs/bookmark.device")
		(dest "devs:")
		(confirm)
		(help "\n\nThis will copy over the bookmark.device program to your "
			"devs: directory\n\nThis is part of the CDTV emulation\n" )
	)
	
	
	;  **********************************************************************
	;  devs:cardmark.device
	;  **********************************************************************
	(complete 30 )
	(protect "devs:cardmark.device" "rwed" )
	(copyfiles
		(prompt "\n\nCopying cardmark.device to the devs: directory.\n" )
		(source "AsimCDFSInst:devs/cardmark.device")
		(dest "devs:")
		(confirm)
		(help "\n\nThis will copy over the cardmark.device program to your "
			"devs: directory\n\nThis is part of the CDTV emulation\n" )
	)
	
	
	;  **********************************************************************
	;  libs:playerprefs.library
	;  **********************************************************************
	(complete 30 )
	(protect "devs:playerprefs.library" "rwed" )
	(copyfiles
		(prompt "\n\nCopying playerprefs.library to the libs: directory.\n" )
		(source "AsimCDFSInst:libs/playerprefs.library")
		(dest "libs:")
		(confirm)
		(help "\n\nThis will copy over the playerprefs.library program to your "
			"libs: directory\n\nThis is part of the CDTV emulation\n" )
	)
))	



(set #instCD32Emul
	(askbool
		(prompt "\n\nShould the CD³² emulation option be installed?")
		(help "\n\nThis will copy over the required files for the "
				"CD³² emulation:\n   devs:cd.device\n   libs:nonvolatile.library\n   libs:lowlevel.library\n\nIf you do not "
				"wish the CD³² emulation option to be transferred to your system, "
				"skip this step.\n" )
		(default 1)
	)
)

(complete 85 )
(if #instCD32Emul
	((complete 30 )
	;  **********************************************************************
	;  devs:cd.device
	;  **********************************************************************
	
	(protect "devs:cd.device" "rwed" )
	(copyfiles
		(prompt "\n\nCopying cd.device to the devs: directory.\n" )
		(source "AsimCDFSInst:devs/cd.device")
		(dest "devs:")
		(confirm)
		(help "\n\nThis will copy over the cd.device program to your "
			"devs: directory\n\nThis is part of the CD³² emulation\n" )
	)
	
	
	;  **********************************************************************
	;  libs:nonvolatile.library
	;  **********************************************************************
	(complete 30 )
	(protect "devs:nonvolatile.library" "rwed" )
	(copyfiles
		(prompt "\n\nCopying nonvolatile.library to the libs: directory.\n" )
		(source "AsimCDFSInst:libs/nonvolatile.library")
		(dest "libs:")
		(confirm)
		(help "\n\nThis will copy over the nonvolatile.library program to your "
			"libs: directory\n\nThis is part of the CD³² emulation\n" )
	)
	
	
	;  **********************************************************************
	;  libs:lowlevel.library
	;  **********************************************************************
	(complete 30 )
	(protect "devs:lowlevel.library" "rwed" )
	(copyfiles
		(prompt "\n\nCopying lowlevel.library to the libs: directory.\n" )
		(source "AsimCDFSInst:libs/lowlevel.library")
		(dest "libs:")
		(confirm)
		(help "\n\nThis will copy over the lowlevel.library program to your "
			"libs: directory\n\nThis is part of the CD³² emulation\n" )
	)
))



;  **********************************************************************
;  default icons in ENV
;  **********************************************************************

(makedir "ENVARC:AsimCDFS"
	(prompt "Making the ENVARC:AsimCDFS directory, in which various default files will be placed.")
	(help "This will create a directory in your ENVARC: directory")
	)

(makedir "ENV:AsimCDFS"
	(prompt "Making the ENV:AsimCDFS directory, in which various default files will be placed.")
	(help "This will create a directory in your ENV: directory")
	)

(copyfiles
	(prompt "\n\nCopying default icons to the ENVARC:AsimCDFS "
			  "directory.\n" )
	(source "AsimCDFSInst:ENVArc/AsimCDFS")
	(dest "ENVArc:AsimCDFS")
	(infos)
	(all)
	(help "\n\nThis will copy over default icon files to the ENVArc:AsimCDFS directory.")
	(confirm)
)

(copyfiles
	(prompt "\n\nCopying default icons to the ENV:AsimCDFS "
			  "directory.\n" )
	(source "AsimCDFSInst:ENVArc/AsimCDFS")
	(dest "ENV:AsimCDFS")
	(infos)
	(all)
	(help "\n\nThis will copy over default icon files to the ENV:AsimCDFS directory.")
	(confirm)
)



;  **********************************************************************
;  ask which languages to be added
;  **********************************************************************
;(if (exists "LOCALE:")
;	((user 2)
;	(set #language
;		(askoptions
;			(prompt "Which language catalogs would you like installed?")
;			(help "The various programs have been configured to the following "
;					"languages:\n    English\n   Deutsch\n   Français\n\nSelect which"
;					"languages you would like to use with our software." )
;			(choices "English" "Deutsch" "Français")
;			(default 1)
;		)
;	)
;	(user #theirlevel)
;	
;	
;	(set n 0)
;	(while
;		(set #langdir
;			(select n "english"
;						 "deutsch"
;						 "français"
;				       ""
;				)
;			)
;		(
;		
;		(if (IN #language n)
;			((set #langdest (tackon "LOCALE:catalogs/" #langdir))
;			(set #langsrc (tackon "AsimCDFSInst:Locale/catalogs/" #langdir))
;			
;			(copyfiles
;				(prompt "\n\nCopying locale " #langdir " language catalogs.\n" )
;				(source #langsrc)
;				(dest #langdest)
;				(infos)
;				(all)
;				(help "\n\nThis will copy over the desired langauge file.")
;				(confirm))
;			)
;		)
;	
;		(set n (+ n 1))
;		)
;	)
;))	
	




;  **********************************************************************
;  Create a 'SYS/NV_Location' environment variable
;  **********************************************************************
(run "setenv SYS/NV_Location AsimCDFS_Buffer:NonVolatile/")


;  **********************************************************************
;  Create a CD³² Preferences file
;  **********************************************************************
(run "AsimCDFS:CD³²_Prefs SAVE DEFAULT")	


;  **********************************************************************
;  Create a CDTV Preferences file
;  **********************************************************************
(run "AsimCDFS:CDTV_Prefs SAVE DEFAULT")	



;  **********************************************************************
;  remove assign to AsimCDFSInst
;  **********************************************************************
(makeassign "AsimCDFSInst")


(complete 100 )
