; *******************************************************************
;
; $VER: Install_Leagues 1.0 (15.3.96)
; 
; Install script for Leagues copyright © 1996 Martin Wulffeld
;
; *******************************************************************

(set old_level @user-level)
(set @default-dest "")

(set default_lang 1)

(set #bad-kick
(cat "You must at least have Kickstart 2.04 to install Leagues!"
))

(set #copying-reqtoools		"\nCopying reqtools.library 38.1296 to LIBS:...")
(set #copying-leagues			"\nCopying Leagues...")
(set #copying-documentation	"\nCopying Leagues documentation...")
(set #copying-regfiles		"\nCopying registration files...")
(set #select-dest			"Please select the path where you want to install Leagues. A drawer named Leagues will be created there.")
(set #select-destguide		"Please select the path where you want to install the Leagues documentation. It has already been installed along with the main program.")
(set #which-language        "\nWhich languages should be installed ?\n")
(set #which-language-help
 (cat "\nThe Amiga can be operated in many different"
	  " languages. If you want Leagues to use the"
      " same language as the Amiga Workbench"
	  " then a catalog file must be copied to your"
	  " harddisk for each language supported.\n\n"
	  "To reduce the amount of space consumed by the"
	  " language files, you can select to have only the"
	  " files of specific languages copied.\n\n"
	  "Simply check the boxes of the languages you wish"
	  " to have available on your system.\n\n"
	  @askoptions-help
))

;=============================================================================
; Make sure we are running under a 2.04 ROM

(if (< (/ (getversion) 65536) 37)
(
    (abort #bad-kick)
))

;=============================================================================

;*** Required libraries

(copylib
	(prompt #copying-reqtools)
	(help @copylib-help)
	(source "Libs/reqtools.library")
	(dest "LIBS:")
	(confirm)
)

;*** Leagues executable

(set programdir
	(tackon
		(askdir
			(prompt  #select-dest)
			(help @askdir-help)
			(default "SYS:")
			(newpath)
		)
		"Leagues"
	)
)

(makedir programdir
	(infos)
)

(set @default-dest programdir)

(copyfiles
	(prompt #copying-leagues)
	(source "Leagues")
	(dest programdir)
	(infos)
)

;*** Copy Catalogs to Leagues dir for backup

(copyfiles
	(prompt #copying-catalogs)
	(source "")
	(dest programdir)
	(pattern "Catalogs#?")
)

;*** Copy registration files

(copyfiles
	(prompt #copying-regfiles)
	(source "")
	(dest programdir)
	(pattern "Registration#?")
)

;*** Documentation files

; Backup

(copyfiles
	(prompt #copying-documentation)
	(source "")
	(dest programdir)
	(pattern "Documentation#?")
)

; Ask if documentation should be installed elsewhere

(set tempdocdir
	(tackon
		programdir
		"Documentation"
	)
)

(set docdir
	(askdir
		(prompt #select-destguide)
		(help @askdir-help)
		(default tempdocdir)
		(newpath)
	)
)

(copyfiles
	(prompt #copying-documentation)
	(source "Documentation/Leagues.guide")
	(dest docdir)
	(infos)
)
