; $VER: Install-Rainboot2 (29.01.97)

;---------------------------- Strings --------------------------------------
(set #kick39-msg "Kickstarts below v39 are not tested, so you might first consider testing the program before installing it.")
(set #destdir-msg "Where you want Rainboot 2.0 to be installed? A drawer called Rainboot will be created.")
(set #libs-msg "Copying libraries...")
(set #dirname "Rainboot")
(set #ptlib-msg "Do you want to install ptreplay.library? It is needed if you want to play Protracker modules with Rainboot2.")
(set #ptlib-help "ptreplay.library is only needed if you want to play Protracker modules with Rainboot2.")
(set #copy-msg "Copying files...")
(set #example-msg "Which of these example configs do you want to install?")
(set #fonts-msg "Do you want to install the fonts also? The examples won't work correctly without these fonts.")
(set #fonts-help "FuturaB, FuturaL and GoudyB are going to be installed in your FONTS: drawer")
(set #start-msg "Do you want Rainboot2 to be copied in your WBstartup drawer?")
(set #start-help "Copying Rainboot2 to your WBStartup drawer closes the bootscreen at the end of the booting. This does not start a new Rainboot2 even if one isn't running. It only stops it.")
(set #wbstart-msg "Where is your WBstartup drawer?")
(set #edit-msg "Now you still have to edit your s:startup-sequence. Just put the line (one line!):\n\n")
(set #edit-msg2 "\n\nsomewhere after the monitordrivers and reset your Amiga.\n(You might also need a MODEID or CGFX argument so check the docs for details)")
(set #edit2-msg "If you want to use Rainboot2 you must first create a config-file (check the docs and the examples) and the put Rainboot2 in your startup-sequence. Somewhere after the monitordrivers is probably a good place")
;----------------------------------------------------------------------------

(if (< (/ (getversion) 65536) 39)
	(message #kick39-msg)
)

(set #destdir
	(askdir
		(prompt	#destdir-msg)
		(help	@askdir-help)
		(default "SYS:")
	)
)

(set @default-dest #destdir)

(makedir (tackon #destdir #dirname) (infos))

(copyfiles
	(prompt #copy-msg)
	(help @copyfiles-help)
	(source "")
	(dest (tackon #destdir #dirname))
	(choices "Rainboot2" "Rainboot2.data" "Docs")
	(infos)
)

(makedir (tackon (tackon #destdir #dirname) "Configs") (infos))

(set #ptlib 
	(askbool
		(prompt #ptlib-msg)
		(help #ptlib-help)
		(default 1)
	)
)

(if #ptlib 
	(copylib
		(prompt #libs-msg)
		(source "Libs/ptreplay.library")
		(dest "LIBS:")
		(help @copylib-help)
		(confirm)
	)
)

(copylib
	(prompt #libs-msg)
	(source "Libs/iff.library")
	(dest "LIBS:")
	(help @copylib-help)
	(confirm)
)

(set #example
	(askoptions
		(prompt #example-msg)
		(help @askoptions-help)
		(choices "Black&White" "Demo")
		(default 1)
	)
)

(if (in #example 0)
	(copyfiles
		(prompt #copy-msg)
		(help @copyfiles-help)
		(source "Configs")
		(dest (tackon (tackon #destdir #dirname) "Configs"))
		(pattern "Black&White#?")
	)
)

(if (in #example 1)
	(copyfiles
		(prompt #copy-msg)
		(help @copyfiles-help)
		(source "Configs")
		(dest (tackon (tackon #destdir #dirname) "Configs"))
		(pattern "(Demo#?|Black&White_glasses.8svx|Black&White.iff)")
	)
)

(set #fonts #example)

(if (= @user-level 2)
	(if #example
		(set #fonts
			(askbool
				(prompt #fonts-msg)
				(help #fonts-help)
				(default 1)
			)
		)
	)
)

(if #fonts
	(copyfiles
		(prompt #copy-msg)
		(help @copyfiles-help)
		(source "Fonts")
		(dest "FONTS:")
		(all)
	)
)

(set #start
	(askbool
		(prompt #start-msg)
		(help #start-help)
		(default 1)
	)
)

(if #start
	((set #wbdir 
		(askdir
			(prompt	#wbstart-msg)
			(help	@askdir-help)
			(default "SYS:WBstartup")
		)
	)
	(copyfiles
		(prompt #copy-msg)
		(help @copyfiles-help)
		(source "")
		(dest #wbdir)
		(choices "Rainboot2" "Rainboot2.info")
	))
)

(if (and #start (in #example 0))
	(message #edit-msg (tackon (tackon #destdir #dirname) "Rainboot2") (tackon (tackon #destdir #dirname) "Configs/Black&White.config") #edit-msg2)
	(message #edit2-msg)
)
