;; Movieguide V3.0 Installer
;; (C) Simon Ravn 1994
;; Revision 1.0

(welcome "Welcome to the MovieGuide 3.0 installation.")

(set is_update 0)
(set @app-name "MovieGuide 3.0")
(set app-name "MovieGuide 3.0")
;(set tmp @user-level)
(set @user-level 2)
(user 2)
;(user tmp)

(set instdir
	(askdir
		(prompt "Please select a destination path for MovieGuide  "
                        "State full pathname, e.g. DH0:Tools/MovieGuide3")
		(help @askdir-help)
		(default "SYS:MovieGuide")
		(newpath)
		(disk)
	)
)
	(
		(if ( = (exists instdir (noreq)) 0)   ;if selected path doesn't exist...
			;then create dir
			(makedir instdir
				(prompt ("creating directory \"%s\"" instdir))
				(help @makedir-help)
				(infos)
				(confirm)
			)
			;else directory is already there - use it.
			;()
		)
	)
(set install_options
	(askoptions
		(prompt "Please select the items to install with MovieGuide 3.0.")
		(help @askoptions-help)
		(choices 
                        "Main Files"
                        "Movie Data Files"
                        "Biographies"
                        "Plot Summaries"
                        "Pictures")
		(default 31)
	)
)
(
	(askdisk sourcedisk
		(prompt "\nPlease insert disk \"MovieGuide 3.0 Disk 1\" in any drive.")
		(help @askdisk-help)
		(dest "MG3_1")
		(assigns)
	)
	(copyfiles
	(source "MG3_1:c/Lharc")
	(dest instdir)
	)
        (copyfiles
        (source "MG3_1:libs/Medplayer.library")
        (dest "libs:")
	)
)
(set DeArcher (tackon instdir "lharc"))
(if (IN install_options 0)
	(
		(set @execute-dir instdir)
			(
		                (working "Installing MovieGuide V3.0 Main Files...")
					(run 
	                        	("%s\ -f x \MG3_1:bin30.lha \ >nil:" DeArcher)
				)
			)
		)
	)
(if (IN install_options 2)
	(
		(set @execute-dir instdir)
			(
		                (working "Installing MovieGuide V3.0 Biographies...")
					(run 
	                        	("%s\ -f x \MG3_1:bio.lha \ >nil:" DeArcher)
					(prompt "dldddd")
				)
			)
		)
	)

(if (IN install_options 4)
	(askdisk sourcedisk
		(prompt "\nPlease insert disk \"MovieGuide 3.0 Disk 2\" in any drive.")
		(help @askdisk-help)
		(dest "MG3_2")
		(assigns)
	)
)
(if (IN install_options 4)
	(
		(set @execute-dir instdir)
			(
		                (working "Installing MovieGuide V3.0 Pictures...")
					(run 
	                        	("%s\ -f x \MG3_2:IMAGES.lha \ >nil:" DeArcher)
				)
			)
		)
	)
(if (IN install_options 1 3)
	(askdisk sourcedisk
		(prompt "\nPlease insert disk \"MovieGuide 3.0 Disk 3\" in any drive.")
		(help @askdisk-help)
		(dest "MG3_3")
		(assigns)
	)
)
(if (IN install_options 3)
	(
		(set @execute-dir instdir)
			(
		                (working "Installing MovieGuide V3.0 Plot Summaries...")
					(run 
	                        	("%s\ -f x \MG3_3:PLOT.lha \ >nil:" DeArcher)
				)
			)
		)
	)
(if (IN install_options 1)
	(
		(set @execute-dir instdir)
			(
		                (working "Installing MovieGuide V3.0 Movie Data...")
					(run 
	                        	("%s\ -f x \MG3_3:DATA1.lha \ >nil:" DeArcher)
				)
			)
		)
	)
(if (IN install_options 1)
	(askdisk sourcedisk
		(prompt "\nPlease insert disk \"MovieGuide 3.0 Disk 4\" in any drive.")
		(help @askdisk-help)
		(dest "MG3_4")
		(assigns)
	)
)
(if (IN install_options 1)
	(
		(set @execute-dir instdir)
			(
		                (working "Installing MovieGuide V3.0 Movie Data...")
					(run 
	                        	("%s\ -f x \MG3_4:DATA2.lha \ >nil:" DeArcher)
				)
			)
		)
	)

(delete DeArcher)

(exit)

;(set @default-dest instdir)
