;
; Installation script for MooVId-PPC 1.2
; by László Török (torokl@alpha.dfmk.hu)
; $VER 1.2 (06.02.2000)
;

; Strings

(set @default-dest "")
(set moovid-source		"Files/MooVId")
(set mooviddocs-source		"Files/doc/MooVId.guide")
(set asynciolib-source		"Files/libs/asyncio.library")
(set reqtoolslib-source		"Files/libs/reqtools.library")
(set indeolib-source		"Files/libs/intelindeo.library")
(set guifont-source		"Files/fonts/GroovyPlayerLCD.font")
(set guifont-source2		"Files/fonts/GroovyPlayerLCD/8")

(set wosppclib			"Files/ppc/wos/moovidppc.library")
(set pupppclib1			"Files/ppc/pup/moovidppc.library")
(set pupppclib2			"Files/ppc/pup/moovidppc.elf")

(set #wos "WarpOS version")
(set #pup "PowerUP version")
(set #AskPPC "Please select which PPC version would you like to install")
(set #AskPPCHelp (cat "Please select one from the two supported PPC kernels\n"))

(set fontdest			"FONTS:")
(set fontdest2			"FONTS:GroovyPlayerLCD")
(set fontmsg			"Installing the GUI font")

(set moovidlib-def-dest		"LIBS:")
(set moovid-def-dest		"Work:")
(set moovid-to			"Where do you want the MooVId mainfile copied in?")
(set docs-to			"Where do you want the MooVId AmigaGuide documentation copied in?")
(set libraries-to		"Where do you want libraries copied in?")
(set Bad-Cpu		"You need at least a Motorola M68020 CPU to run MooVId")
(set path-help		(cat      "Select a path where you want to put the mainfile\n"))
(set path-help2		(cat      "Select a path where you want to put the documentation\n"))
(set wrong-kick			"You must be running Kickstart 3.0+ to run MooVId.")
(set copy-msgm1			"Copying the mainfile to ")
(set copy-msgm2			"Copying the documentation to ")
(set copy-reqtools		"Copying the reqtools.library to LIBS:")
(set copy-indeo 		"Copying the intelindeo.library to LIBS:")
(set copy-async			"Copying the asyncio.library to LIBS:")
(set copy-ppclib		"Copying the moovidppc.library to LIBS:")
(set asynchelp			"MooVId requires asyncio.library 39.2 or better")
(set reqtoolshelp		"MooVId requires reqtools.library 38 or better")
(set indeohelp			"MooVId requires intelindeo.library for Indeo® 3.1/3.2 playback")
(set fonthelp			"MooVId requires GroovyPlayerLCD font for the GUI")
(set mainhelp			"This part will copy the mainfile")
(set docshelp			"This part will copy the documentation")
(set hail-msg
        (cat      "\n\n\nMooVId installation script.\n"
                  "This script will install MooVId on your Amiga.\n\n"
                  "MooVId is\n(C) Copyright 1996-2000 László Török.\n"
                  "All Rights Reserved."
        )
)

; Correct OS version?

(if (< (/ (getversion) 65536) 39) (abort wrong-kick))

; 68020+ present?

(if (patmatch "68000|68010" (database "cpu")) (abort Bad-Cpu))

(message hail-msg)

(copyfiles
	(prompt fontmsg)
	(help   fonthelp)
	(source guifont-source)
	(dest   fontdest)
	(confirm)
)

(copyfiles
	(prompt fontmsg)
	(help   fonthelp)
	(source	guifont-source2)
	(dest   fontdest2)
	(confirm)
)

; Ask where to copy the libraries.

(set libs-dest
	(askdir
		(prompt  libraries-to)
		(help    path-help)
		(default moovidlib-def-dest)
	)
)

;copy the asyncio.library

(copylib
	(prompt copy-async)
	(help   asynchelp)
	(source asynciolib-source)
	(dest   libs-dest)
	(confirm)
)

;copy the reqtools.library


(copylib
	(prompt copy-reqtools)
	(help   reqtoolshelp)
	(source reqtoolslib-source)
	(dest   libs-dest)
	(confirm)
)

;copy the intelindeo.library


(copylib
	(prompt copy-indeo)
	(help   indeohelp)
	(source indeolib-source)
	(dest   libs-dest)
	(confirm)
)


; Ask where to copy the mainfile.

(set moovid-dest
	(askdir
		(prompt  moovid-to)
		(help    path-help)
		(default moovid-def-dest)
	)
)

; Copy the mainfile.

(copyfiles
	(prompt (cat copy-msgm1))
	(help   mainhelp)
	(source moovid-source)
	(dest   moovid-dest)
	(confirm)
	(infos)
)

; Ask where to copy the docs.

(set mooviddocs-dest
	(askdir
		(prompt  docs-to)
		(help    path-help2)
		(default moovid-dest)
	)
)

; Copy the mainfile.

(copyfiles
	(prompt (cat copy-msgm2))
	(help   docshelp)
	(source mooviddocs-source)
	(dest   mooviddocs-dest)
	(confirm)
	(infos)
)

(delete (tackon libs-dest (cat "moovidppc.library")))
(delete (tackon libs-dest (cat "moovidppc.elf")))

(set #_PPCKernel
	(askchoice
		(prompt #AskPPC)
		(help #AskPPCHelp)
		(choices
			"WarpOS version"
			"PowerUP version"
		)
	)
)

(if (= #_PPCKernel 1)

(
	(copylib
		(source pupppclib1)
		(dest   libs-dest)
	)
	(copyfiles
		(source pupppclib2)
		(dest   libs-dest)
	)
)

	(copylib
		(source wosppclib)
		(dest   libs-dest)
	)
)
