;  $VER: Install-Essence-II (6.20.93)
; 
;  Copyright © 1993 Apex Software Publishing


(complete 1)

(if (exists (tackon @default-dest "Imagine") (noreq))
     (set imdir (tackon @default-dest "Imagine"))
     (set imdir @default-dest))

(set notfound 1) 
(while (= notfound 1) (

(set imdir (askdir 
  (default imdir)
  (prompt "It is STRONGLY recommended that you install Essence "
  "in the same directory where you have Imagine installed. " 
  "Please select the directory which contains your Imagine program.")
  (help "The installer needs to know where to put the files. By specifying "
        "the directory where Imagine is, the installer knows where to put "
        "the Essence files.")))

(if (OR (= 1 (exists (tackon imdir "Imagine") (noreq)))
        (= 1 (exists (tackon imdir "ImagineFP") (noreq))))
(set notfound 0)
(if (askbool (prompt "I can't find the Imagine program in the directory "
                 "you specified. Are you SURE you want to install Essence "
                 "in this directory?" )
         (help "You really want to put Essence in the same directory as "
               "Imagine. However, you might have renamed the Imagine program, "
               "confusing me; if you want me to go ahead, I will."))
     (set notfound 0)
))))

(if (> 2600000 (getdiskspace imdir)) 
    (abort "You need at least 2.6 megabytes of disk space free to install "
           "Essence II. You'll need to free up some space before Essence "
           "II can be installed."))

(complete 2)

(if (= (getassign "t") "")  (makeassign "t" "ram:"))

(copyfiles (source "EssII_Disk_1:c/gzip") (dest "t:"))
(copyfiles (source "EssII_Disk_1:c/tar") (dest "t:"))

(complete 4)

(set essdir (tackon imdir "Essence"))
(set esspicsdir (tackon imdir "EssPics"))
(set essbumpdir (tackon imdir "Essence/Bumpythings"))

(if (NOT (= 2 (exists essdir (noreq)))) (makedir essdir (infos)) )

(if  (= 2 (exists essbumpdir (noreq)))
	
  ((message "Hmm, it looks like there's a copy (or partial copy) "
            "of Essence Volume II already here. Do you want to "
            "reinstall over the file(s) here, or abort the install?")
   )
; maybe delete the existing files here, but not necessary.
)

(complete 6)

(copyfiles (source "EssII_Disk_1:extra.tar") (dest "t:"))
(complete 7)
(copyfiles (source "EssII_Disk_1:atts.tar.z") (dest "t:"))
(complete 9)
(set @execute-dir imdir)
(run "t:tar -xf t:extra.tar")
(complete 13)
(delete "t:extra.tar")
(complete 14)
(working "Decompressing attribute files..")
(run "t:gzip -d t:atts.tar.z")
(complete 20)
(working "Saving attribute files..")
(run "t:tar -xf t:atts.tar")
(complete 25)
(delete "t:atts.tar")
(copyfiles (source "EssII_Disk_1:pics1.tar.z") (dest "t:"))
(complete 30)
(working "Decompressing picture files...")
(run "t:gzip -d t:pics1.tar.z")
(complete 35)
(working "Saving picture files..")
(run "t:tar -xf t:pics1.tar")
(complete 39)
(delete "t:pics1.tar")
(set @execute-dir essdir)
(copyfiles (source "EssII_Disk_1:textures.tar.z") (dest "t:"))
(complete 43)
(working "Decompressing texture files...")
(run "t:gzip -d t:textures.tar.z")
(complete 48)
(working "Saving texture files..")
(run "t:tar -xf t:textures.tar")
(complete 57)
(delete "t:textures.tar")
(complete 61)
(askdisk (dest "EssII_Disk_2")
  (prompt "Please Insert Essence Volume II Disk 2")
  (help "Insert Disk 2 in any drive.  Files will be read from "
 "Disk 2, and installed in the Essence directory. Nothing on "
 "the disk will be changed."
  )
)
(copyfiles (source "EssII_Disk_2:pics2.tar.z") (dest "t:"))
(complete 68)
(working "Decompressing more pictures...\n")
(run "t:gzip -d t:pics2.tar.z")
(complete 70)
(working "Saving more pictures.")
(set @execute-dir esspicsdir)
(run "t:tar -xf t:pics2.tar")
(copyfiles (source "EssII_Disk_2:pics3.tar.z") (dest "t:"))
(complete 79)
(working "Decompressing still more pictures...\n"
"\n\nAlmost there!")
(run "t:gzip -d t:pics3.tar.z")
(complete 87)
(working "Saving the last files!\n\n\n"
"You'll be able to use Essence II in just one minute!"
)
(set @execute-dir esspicsdir)
(run "t:tar -xf t:pics3.tar")
(complete 97)
(set @default-dest imdir)
(delete "t:pics2.tar")
(delete "t:tar")
(delete "t:gzip")
(delete "t:pics3.tar")
(complete 100)

