
;
; Marvin's Marvellous Adventure
; © 21st Century Entertainment, Ltd.
; 
; written by Florian W. Sauer
;            Tobias Prinz
;            MegaLoMania
;
; HD INSTALLER V1.0 - Samstag 12-Nov-94 00:13:40
; ~~~~~~~~~~~~~~~~~

(complete 0)

(message "MARVIN'S MARVELLOUS ADVENTURE is going to be installed to your hard drive.\n\n"
         "This game will need about 6.5 MB of diskspace and about 1.8MB of graphics memory.\n\n"
	 "When running 'Marvin' from hard drive, please make sure that there is enough graphics "
	 "memory available. A better choice is a memory expansion which also makes "
	 "your AMIGA(tm) twice as fast !\n\n\n"
	 "Select PROCEED if you want to continue, hit ABORT otherwise."
)

(set name
	(askdir
		(prompt "Please select a location for installing the game.\nThe installer will create a directory 'MARVIN', containing all game data, at this location.")
		(help @askdir-help)
		(default "WORK:")
	)
)

; get volume/directory name correctly...

(if (= (substr name (- (strlen name) 1) 1) ":")
	(set dummy "42" )
	(set name (cat name "/") )
)

(set @default-dest name)

(if (< (getdiskspace name) 6500000)
	(abort "Ouups... There is not enough diskspace avaiable.\n\nPlease select an other directory or device.")
	(set dummy "42")
)

(if (exists "sys:Prefs/Env-Archive/Sys"	(noreq))
	(if (exists "sys:prefs/env-archive/sys/nv_location" (noreq))
		(message "YEAH !\n\nYou've an NV-STORAGE already installed.\nThat's pretty cool.\n\n"
	                 "Marvin's Marvellous Adventure will use this..."
		)
		(
			(makedir "sys:prefs/nonvolatile"
				(prompt "I will now create the directories for the NV-STORAGE.")
				(help @makedir-help)
				(infos)
			)
			(textfile
				(dest "sys:prefs/env-archive/sys/nv_location")
				(prompt "Creating your NV-STORAGE.")
				(help "This installs a NV-STORAGE for OS3.1 onto your hard drive.")
				(append "sys:prefs/nonvolatile")
			)
		)
	)
	(message "Upps...\n\nYour Workbench(tm) System Software seems not to be installed correctly !\n\n"
                 "However, this does *NOT* affect this installation procedure."
	)
)

(makedir (cat name "Marvin")
	(prompt "I will now create the directories for the game.")
	(help @makedir-help)
	(infos)
	(confirm)
)

(makedir (cat name "Marvin/cdraw")
	(prompt "I will now create the directories for the game.")
	(help @makedir-help)
)

(makedir (cat name "Marvin/mlevs")
	(prompt "I will now create the directories for the game.")
	(help @makedir-help)
)

(makedir (cat name "Marvin/music")
	(prompt "I will now create the directories for the game.")
	(help @makedir-help)
)

(makedir (cat name "Marvin/languages")
	(prompt "I will now create the directories for the game.")
	(help @makedir-help)
)

(complete 5)

(copyfiles
	(optional "askuser")
	(files)
	(prompt "Copying program files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_BOOT:")
	(dest (cat name "Marvin/") )
	(infos)
	(pattern "marv#?")
	(confirm)
)

(copylib
	(optional "askuser")
	(prompt "Copying libraries...")
	(help @copylib-help)
	(source "MMA_DISKY_BOOT:libs/color_fx.library")
	(dest "libs:")
	(confirm)
)

(complete 10)

(copylib
	(optional "askuser")
	(prompt "Copying libraries...")
	(help @copylib-help)
	(source "MMA_DISKY_BOOT:libs/lowlevel.library")
	(dest "libs:")
	(confirm)
)

(copylib
	(optional "askuser")
	(prompt "Copying libraries...")
	(help @copylib-help)
	(source "MMA_DISKY_BOOT:libs/nonvolatile.library")
	(dest "libs:")
	(confirm)
)

(complete 15)

(copylib
	(optional "askuser")
	(prompt "Copying libraries...")
	(help @copylib-help)
	(source "MMA_DISKY_BOOT:libs/mathieeedoubtrans.library")
	(dest "libs:")
	(confirm)
)

(copylib
	(optional "askuser")
	(prompt "Copying libraries...")
	(help @copylib-help)
	(source "MMA_DISKY_BOOT:libs/mathieeedoubbas.library")
	(dest "libs:")
	(confirm)
)

(complete 20)

(copyfiles
	(optional "force")
	(prompt "Copying map files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_BOOT:mlevs")
	(dest (cat name "Marvin/mlevs") )
	(pattern "#?")
	(files)
)

(complete 25)

(copyfiles
	(optional "force")
	(prompt "Copying language files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_BOOT:languages")
	(dest (cat name "Marvin/languages") )
	(pattern "#?")
	(files)
)

(complete 30)

; BUILD WORK FILE

(copyfiles
	(optional "askuser")
	(prompt "Copying program files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_BOOT:c/")
	(dest "ram:")
	(pattern "#?")
)

(copyfiles
	(optional "askuser")
	(prompt "Copying program files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_BOOT:")
	(dest (cat name "Marvin/") )
	(pattern "prog#?")
)

(working "\nUnpacking MC68020 program file..."
)

(run (cat "ram:unpacker2 d " (cat name "Marvin/prog.atom ") (cat name "Marvin/work"))
	(help "This will unpack the executable to your hard drive.")
	(prompt "Unpacking program files...")
)

(complete 35)

(delete (cat name "Marvin/prog.atom")
	(help "This will cleanup...")
	(prompt "Unpacking program files...")
)

(complete 40)

(delete "ram:iconx"
	(help "This will cleanup your RAMDISK.")
	(prompt "Unpacking program files...")
)

(complete 42)

(delete "ram:setpatch"
	(help "This will cleanup your RAMDISK.")
	(prompt "Unpacking program files...")
)

;----------- build of work complete...

(askdisk
	(prompt "\nPlease insert disk two." )
	(help @askdisk-help )
	(dest "MMA_DISKY_ONE" )
)

(complete 43)

(copyfiles
	(optional "force")
	(prompt "Copying graphic files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_ONE:cdraw")
	(dest (cat name "Marvin/cdraw") )
	(pattern "#?")
	(files)
)

(complete 45)

(copyfiles
	(optional "force")
	(prompt "Copying map files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_ONE:mlevs")
	(dest (cat name "Marvin/mlevs") )
	(pattern "#?")
	(files)
)

(copyfiles
	(optional "force")
	(prompt "Copying music files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_ONE:music")
	(dest (cat name "Marvin/music") )
	(pattern "#?")
	(files)
)

(complete 50)

(askdisk
	(prompt "\nPlease insert disk three.")
	(help @askdisk-help)
	(dest "MMA_DISKY_TWO")
)

(copyfiles
	(optional "force")
	(prompt "Copying graphic files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_TWO:cdraw")
	(dest (cat name "Marvin/cdraw") )
	(pattern "#?")
	(files)
)

(complete 55)

(copyfiles
	(optional "force")
	(prompt "Copying map files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_TWO:mlevs")
	(dest (cat name "Marvin/mlevs") )
	(pattern "#?")
	(files)
)

(complete 65)

(copyfiles
	(optional "force")
	(prompt "Copying music files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_TWO:music")
	(dest (cat name "Marvin/music") )
	(pattern "#?")
	(files)
)

(complete 75)

(askdisk
	(prompt "\nPlease insert disk four.")
	(help @askdisk-help)
	(dest "MMA_DISKY_THREE")
)

(copyfiles
	(optional "force")
	(prompt "Copying graphic files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_THREE:cdraw")
	(dest (cat name "Marvin/cdraw") )
	(pattern "#?")
	(files)
)

(complete 80)

(copyfiles
	(optional "force")
	(prompt "Copying map files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_THREE:mlevs")
	(dest (cat name "Marvin/mlevs") )
	(pattern "#?")
	(files)
)

(complete 85)

(copyfiles
	(optional "force")
	(prompt "Copying music files...")
	(help @copyfiles-help)
	(source "MMA_DISKY_THREE:music")
	(dest (cat name "Marvin/music") )
	(pattern "#?")
	(files)
)

(complete 90)

(working "Unpacking Graphics...")
(foreach (cat name "Marvin/cdraw/") "#?" 
	(
		(run (cat "ram:unpacker file " name "Marvin/cdraw/" @each-name) )
	)
)

(complete 92)

(working "Unpacking Maps...")
(foreach (cat name "Marvin/mlevs/") "#?" 
	(
		(run (cat "ram:unpacker file " name "Marvin/mlevs/" @each-name) )
	)
)

(complete 94)

(working "Unpacking Music...")
(foreach (cat name "Marvin/music/") "#?" 
	(
		(run (cat "ram:unpacker file " name "Marvin/music/" @each-name) )
	)
)

(complete 96)

(working "Unpacking Languages...")
(foreach (cat name "Marvin/languages/") "#?" 
	(
		(run (cat "ram:unpacker file " name "Marvin/languages/" @each-name) )
	)
)

(complete 98)

(delete "ram:unpacker"
	(help "This will cleanup your RAMDISK.")
	(prompt "Cleanup...")
)

(complete 100)

(message "The people who had made this game wish you much fun playing it !\n\n"
	 "Florian W. Sauer\nTobias Prinz\nNils Ruzika\nBarry Simpson\nStewart Gilray"
)
