SYS:Utilities/multiview splashscreen.png

requestfile Title "Where do you wish to install Jack? (A drawer will be created)" drawersonly noicons >ENV:jack_destination

requestchoice title "Jack Intaller" body "Does your Classic Amiga have a Floating Point Unit (FPU?)" gadgets "Yes" "No" "Don't know (Use non-FPU)" >ENV:jack_fpu

echo $jack_fpu

if $jack_fpu eq 1
	copy Executables/Classic/JackFPU "$jack_destination" QUIET
else
	copy Executables/Classic/Jack "$jack_destination" QUIET
endif

if exists ENV:jack_destination

	copy Distribution/#? "$jack_destination" ALL QUIET

	copy Executables/Classic/jack "$jack_destination" QUIET

	; Cannot check openurl version string because invalid
	if not exists c:openurl
		copy utilities/classic/openurl c: QUIET
	endif

	if not exists "SYS:Prefs/OpenURL"
		copy "utilities/classic/prefs/OpenURL" SYS:Prefs/ QUIET
		copy "utilities/classic/prefs/OpenURL.info" SYS:Prefs/ QUIET
	endif

	if not exists libs:openurl.library
		copy libs/classic/openurl.library libs: QUIET
	endif

	if not exists libs:hollywood
		makedir libs:hollywood
	endif

	; INSTALL HOLLYWOOD PLUG-INS WHERE REQUIRED
	if exists libs:Hollywood
		if exists libs:hollywood/avcodec.hwp
			version >nil: libs:hollywood/avcodec.hwp 1
			if warn
				copy plug-ins/classic/avcodec.hwp libs:hollywood/ QUIET
			endif
		else
			copy plug-ins/classic/avcodec.hwp libs:hollywood/ QUIET
		endif
		if exists libs:hollywood/svgimage.hwp
			version >nil: libs:hollywood/svgimage.hwp 1
			if warn
				copy plug-ins/classic/svgimage.hwp libs:hollywood/ QUIET
			endif
		else
			copy plug-ins/classic/svgimage.hwp libs:hollywood/ QUIET
		endif
		if exists libs:hollywood/vectorgraphics.hwp
			version >nil: libs:hollywood/vectorgraphics.hwp 1
			if warn
				copy plug-ins/classic/vectorgraphics.hwp libs:hollywood/ QUIET
			endif
		else
			copy plug-ins/classic/vectorgraphics.hwp libs:hollywood/ QUIET
		endif
		if exists libs:hollywood/oggtheora.hwp
			version >nil: libs:hollywood/oggtheora.hwp 1
			if warn
				copy plug-ins/classic/oggtheora.hwp libs:hollywood/ QUIET
			endif
		else
			copy plug-ins/classic/oggtheora.hwp libs:hollywood/ QUIET
		endif
		if exists libs:hollywood/oggvorbis.hwp
			version >nil: libs:hollywood/oggvorbis.hwp 1
			if warn
				copy plug-ins/classic/oggvorbis.hwp libs:hollywood/ QUIET
			endif
		else
			copy plug-ins/classic/oggvorbis.hwp libs:hollywood/ QUIET
		endif
	endif
	if exists libs:hollywood/moviesetter.hwp
		version >nil: libs:hollywood/moviesetter.hwp 1 1
		if warn
			copy plug-ins/Classic/moviesetter.hwp libs:hollywood/ QUIET
		endif
	else
		copy plug-ins/Classic/moviesetter.hwp libs:hollywood/ QUIET
	endif
	if exists libs:hollywood/flicanim.hwp
		version >nil: libs:hollywood/flicanim.hwp 1
		if warn
			copy plug-ins/Classic/flicanim.hwp libs:hollywood/ QUIET
		endif
	else
		copy plug-ins/Classic/flicanim.hwp libs:hollywood/ QUIET
	endif
	if not exists ENVARC:Jack
		makedir ENVARC:Jack
	endif

	delete ENV:jack_destination QUIET

	run >nil: SYS:Utilities/multiview endsplash.png
endif

