;**************************************
; Installscript
;
; (C) Peter Melchart
;
; Installationsskript Festplatte  ENGLISH
;**************************************



size 2716213                     ;gesamtgr”áe der kopierten daten (ohne entpackte daten)
space 8000000            ;gesamtben”tigter speicherplatz

clrscr 0

window 9,1,1,80,3,9,1
text 2,2,9,1,                         THE CLUE! Harddisk Installer

palette 0,0,16,12
;palette 1,0,0,0
;palette 2,0,42,44
;palette 3,0,34,42
;palette 4,40,8,8
;palette 5,30,0,42
;palette 6,42,21,40
;palette 7,42,42,42
;palette 8,21,21,21
;palette 9,21,21,63
;palette 10,31,32,31
;palette 11,21,63,63
;palette 12,63,21,21
;palette 13,40,21,63
;palette 14,63,63,0
;palette 15,63,63,63

set copy 13


;hauptprogramm

:main
	escape main
		Cmenu 1,please select
		 ³      #Show info      ³
		 ³       #Install       ³
		 ³         #End         ³
	end menu

;*********************************** Info anzeigen
	mr 1,1
		exists 1,$path\install.inf
			Showfile 1,5,80,20,11,3,$path\install.inf
			goto nodiskfile
		end exists 1
		Showfile 1,5,80,20,11,3,$source:\install.inf
	:nodiskfile
		goto main
	end mr 1

;*********************************** Installieren
	mr 1,2
				escape main
				reset
				select drive
				escape close1
				window 4,1,17,80,20,11,3
				text 20,18,0,3,Please enter target-directory
				text 17,19,0,3,Not existing directories will be created
				getpath THECLUE
				goto goon
		   :close1
				close window 4
				goto main
		   :goon
				close window 4

				window 2,1,5,80,10,11,3
				define output 2,6,79,9

				escape endinstall
				show percent 15,23

				insert 1,lha.exe
				echo 0,3,copying file lha.exe to $path\
				copy $source:\lha.exe $path
				echo 0,3,

				echo 0,3,copying file tcintro.lzh to $path\
				copy $source:\tcintro.lzh $path
				echo 0,3,decrunching file tcintro.lzh to $path\
				exec $path\lha.exe x /n2 $path\tcintro.lzh $path\
				delete $path\tcintro.lzh
				echo 0,3,

				echo 0,3,copying file install.inf to $path\
				copy $source:\install.inf $path
				echo 0,3,

				echo 0,3,copying file tcsounds.lzh to $path\
				copy $source:\tcsounds.lzh $path
				echo 0,3,decrunching file tcsounds.lzh to $path\
				exec $path\lha.exe x /n2 $path\tcsounds.lzh $path\
				delete $path\tcsounds.lzh
				echo 0,3,

				echo 0,3,copying file tctexts.lzh to $path\
				copy $source:\tctexts.lzh $path
				echo 0,3,decrunching file tctexts.lzh to $path\
				exec $path\lha.exe x /n2 $path\tctexts.lzh $path\
				delete $path\tctexts.lzh
				echo 0,3,

				echo 0,3,copying file tcexecs.lzh to $path\
				copy $source:\tcexecs.lzh $path
				echo 0,3,decrunching file tcexecs.lzh to $path\
				exec $path\lha.exe x /n2 $path\tcexecs.lzh $path\
				delete $path\tcexecs.lzh
				echo 0,3,

				echo 0,3,copying file tcsample.lzh to $path\
				copy $source:\tcsample.lzh $path
				echo 0,3,decrunching file tcsample.lzh to $path\
				exec $path\lha.exe x /n2 $path\tcsample.lzh $path\
				delete $path\tcsample.lzh
				echo 0,3,

				echo 0,3,copying file tcddisk.lzh to $path\
				copy $source:\tcddisk.lzh $path
				echo 0,3,decrunching file tcddisk.lzh to $path\
				exec $path\lha.exe x /n2 $path\tcddisk.lzh $path\
				delete $path\tcddisk.lzh
				echo 0,3,

				echo 0,3,copying file tcdata.lzh to $path\
				copy $source:\tcdata.lzh $path
				echo 0,3,decrunching file tcdata.lzh to $path\
				exec $path\lha.exe x /n2 $path\tcdata.lzh $path\
				delete $path\tcdata.lzh
				echo 0,3,

				echo 0,3,copying file install.inf to $path\
				copy $source:\install.inf $path
				echo 0,3,

				insert 2,tcpicts.lzh
				echo 0,3,copying file tcpicts.lzh to $path\
				copy $source:\tcpicts.lzh $path
                                echo 0,3,decrunching file tcpicts.lzh to $path\
				exec $path\lha.exe x /n2 $path\tcpicts.lzh $path\
				delete $path\tcpicts.lzh
				echo 0,3,

				delete $path\lha.exe
				exists 1,$path\install.inf
						ShowFile 1,5,80,20,11,3,$path\install.inf
				end exists 1

				goto configsb
:endinstall
				clear output
				close window 2
				hide percent
				goto main
:configsb
				clear output
				close window 2
				hide percent

		goto main

	end mr 1

;************************************ Ende
	mr 1,3
		goto ende
	end mr 1
	goto main
:ende
	exists 1,$path\pictures\sky1
		request 1,[#OK]@installation complete. run the game by entering "theclue", or configure your system with "setup".
		goto ee
	end exists 1
        request 1,[#YES]@[#NO]@installation is not complete. quit anyway?
	rr 1,2
		goto main
	end rr 1
 :ee

	close window 9
	clrscr 0

clrscr 0
