; UTG Installation Script
; The UTG Program, Music, Maps and Graphics are
; (C)Copyright 1993 Chris Hurley
; All Rights Reserved.


(set name
	(askdir
		(prompt "Choose where to install UTG Drawer ")
		(help @askdir-help)
		(default "")
	)
)

(set @default-dest 
	( tackon name "UTG") 
)

(makedir @default-dest
	(infos)
)

(message "Ready to Install the UTG Program:\n"
	 " UTG Main Program \n"
	 " Music, Maps, Font medplayer.library and reqtools.library.\n"
	 " You may wish to back-up your reqtools.library, and medplayer.library\n"
	 " to a safe place before running this installation.\n"
	 " the Fonts and Libs, will be installed on the \n"
  	 " current SYSTEM drive.\n")
(set error (trap 4 1
	(copyfiles
		(source "UTGPackage/fonts")
		(dest "sys:fonts")
		(all)
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the UTG font." @ioerr ))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)
	)
(set error (trap 4 1
	(copylib
		(source "UTGPackage/libs/reqtools.library")
		(dest "sys:libs")
		
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the reqtools library." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)
(set error (trap 4 1
	(copylib
		(source "UTGPackage/libs/medplayer.library")
		(dest "sys:libs")
		
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the medplayer library." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)
(set error (trap 4 1 
	(copyfiles
		(source "UTGPackage/UTG")
		(dest @default-dest)
		(infos)
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the UTG program." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)
(set error (trap 4 1 
	(copyfiles
		(source "UTGPackage/character")
		(dest @default-dest)
		(infos)
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the UTG characters." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)
(set error (trap 4 1 
	(copyfiles
		(source "UTGPackage/UTGLiterature")
		(dest @default-dest)
		(infos)
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the utg literature." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)

(set error (trap 4 1 
	(copyfiles
		(source "UTGPackage/UTGmapIFF")
		(dest @default-dest)
		(infos)
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the UTG map." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)
;***prepare to copy music
(set draw-dest 
	(tackon @default-dest "music")
)
(makedir draw-dest
	(infos)
)

(set error (trap 4 1 
	(copyfiles
		(source "UTGPackage/music")
		(dest draw-dest)
		(all)
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the UTG Music." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)
;***prepare to copy maps
(set draw-dest 
	(tackon @default-dest "maps")
)
(makedir draw-dest
	(infos)
)
(set error (trap 4 1 
	(copyfiles
		(source "UTGPackage/maps")
		(dest draw-dest)
		(all)
	)
)) (if (= error 4 ) 
	(abort ("Dos Error %ld detected while copying the UTG Maps." @ioerr))
	(if (= error 1 ) 
		(abort ("The UTG Installation has Been aborted. Should you want to install it later, you may simply use the installer again."  ))
		)

	)

(set stashlevel @user-level)

(set @user-level 1)
(message "The UTG Program, Music, Maps and Graphics are \n"
	"(C)Copyright 1993, Chris Hurley\n"
	"All Rights Reserved.\n\n"
	" Before Running UTG, Make sure that "
	"you read and understand the discussion "
	"about tooltypes in the UTGInstall Notes document.")
(set @userlevel stashlevel)

