;
; $VER: jpeg_cdc_install 1.0 (16.12.94)
;
; Copyright (c) 1994 Christoph Feck, TowerSystems.
;

;****************************************************************************
;
; English texts
;

(set #bad-kick (cat "You must have AmigaOS Release 2.04 or newer to be able "
	"to use the JPEG Codec.")
)

(set #temp-file (cat "    To decode certain JPEG images, the Codec needs "
	"a large amount of memory.\n    If the required storage is not available "
	"in main memory, the Codec will create a temporary file on your "
	"harddisk.  The volume on which this file is created should have enough "
	"free space (about 4 meg).\n    A temporary file is usually only "
	"required, if you want to quantize JPEG images to 256 colors.\n\n"
	@askdir-help)
)

(set #make-assign (cat "    The logical assignment \"JPEGTMP:\" is used to "
	"refer to the temporary directory.\n    In order to make this assignment "
	"available on every reboot, an \"Assign\" command has to be added to "
	"your \"user-startup\" file.\n\n" @startup-help)
)

;****************************************************************************
;
; Setup
;

(set @default-dest "")

(set libs-dest "LIBS:")
(set class-dest "SYS:Classes")

(if (not (exists class-dest))
	(set class-dest "LIBS:")
)

(complete 0)

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

;****************************************************************************
;
; Welcome
;

(welcome)

(message "\n\n\nTower JPEG Codec Class\n\nCopyright  1994 Christoph "
	"Feck, TowerSystems\nAll Rights Reserved.\n\n\n\nPlease refer to the "
	"documentation for details."
)

;****************************************************************************
;
; JPEGTMP: assignment
;

(set has-temp 0)

(if (exists "JPEGTMP:" (noreq))
	(
		(set has-temp 1)
		(if (= "RAM" (getdevice "JPEGTMP:"))
			(set has-temp 0)
		)
	)
)

(if (= has-temp 0)
	(
		(set jpeg-tmp (askdir (help #temp-file) (prompt "Select a directory for temporary files, not in RAM:") (default "SYS:")))
		(startup "JPEG Codec"
			(help #make-assign)
			(prompt "An assignment has to be added to your user-startup.")
			(command "Assign JPEGTMP: \"" jpeg-tmp "\"")
		)
		(makeassign "JPEGTMP" jpeg-tmp)
	)
)

(complete 10)

;****************************************************************************
;
; Install libraries and classes
;

(copylib
	(help @copylib-help)
	(prompt "Copying tower.library...")
	(source "Libs/tower.library")
	(dest libs-dest)
	(confirm)
)

(complete 30)

(copylib
	(help @copylib-help)
	(prompt "Copying codec.class...")
	(source "Classes/codec.class")
	(dest class-dest)
	(confirm)
)

(complete 50)

(copylib
	(help @copylib-help)
	(prompt "Copying picture.codec...")
	(source "Classes/Codecs/picture.codec")
	(dest (tackon class-dest "Codecs"))
	(confirm)
)

(complete 70)

(copylib
	(help @copylib-help)
	(prompt "Copying jpeg.codec...")
	(source "Classes/Codecs/jpeg.codec")
	(dest (tackon class-dest "Codecs"))
	(confirm)
)

;****************************************************************************
;
; Exit
;

(run "Avail >NIL: FLUSH")
(complete 100)
(exit)

