
(set osversion (/ (getversion) 65536))

(message
   "\n\nWelcome to the DiskExpander HD installation!\n\n"
   "Cracked By Skid Row Supplied By Fireflash\n"
   "This utility program installs DiskExpander\nand all programs belonging "
   "to the DiskExpander software package on hard disk.\n\n"
   "Please hold the original program disk in drive DF0: during the "
   "installation process."
)

(askdisk
   (dest "DiskExpander")
   (prompt "\n\n\n\n\nPlease insert your DiskExpander original disk "
           "into internal drive DF0:"
   )
   (help "The install program needs the disk for installing programs and "
         "data on your hard disk."
   )
)

(message
   "\n\nIf this is the first installation of DiskExpander, you'll be asked to "
   "enter your personal data when the program is started. These Data will be "
   "stored \non the original Disk.\n\nPlease ensure that you enter your data "
   "correctly! \nThis, together with returning the registration card, "
   "allows you to gain cheap updates to future versions of DiskExpander "
   "containing more and enhanced features."
)
;(run "DiskExpander:c/DEProtect con:30/50/600/150/Personal_Data_Input")


(message
   "\n\n\n\nYour personal data and the system configuration have been "
   "stored on the diskette.\n\n"
   "Please write-protect your original DiskExpander program disk now."
   "The programs and data files belonging to DiskExpander will now be "
   "copied to your hard disk."
)

(complete 0)

(set @default-dest
   (askdir
	   (prompt "Please select the directory where the "
              "DiskExpander programs shall be stored.\n"
      )
		(help
		   "You must select the name of the target directory "
			"to which all DiskExpander programs will be copied. \n\n"
         "A new subdirectory will be created in the chosen directory. This "
         "is where the data files will be stored."
      )
      (default "Work:")
   )
)

(set realdest  @default-dest )

(if
   (= (exists realdest) 0)
	   (makedir realdest (infos))
)

(complete 5)

(if (= @user-level 2)
   (
	   (set libflag
		   (askoptions
			   (prompt
               "Please select the compression libraries to be installed "
               "on the hard disk.:"
				)
				(help
               "To adjust DiskExpander for specific purposes, "
               "the program allows you to choose the compression library "
               "that suits best your personal needs.\n\n"
               "For detailed information on the compression libraries, please "
               "read the manual that comes along with DiskExpander or the "
               "file ReadMe! on the original disk."
            )
				(choices
					"epu0"
               "epu1"
               "NUKE"
               "BLZW"
               "FAST"
               "SHRI"
				)
				(default 65535)
			)
		)

		(if
			(askbool
            (prompt "\n\nDo you want DiskExpander to be installed using the "
                    "graphical appearance of Workbench 2.0?")
            (help
               "When Workbench 2.0 was released, the basic Workbench colors "
               "black and white have been exchanged due to technical reasons. "
               "Therefore, icons especially designed for use with Workbench 1.3 "
               "look unsightly when used with Workbench 2.0.\n\n"
               "To avoid this effect, DiskExpander contains different icons "
               "for both versions of the operating system.\n\n"
               "Please install the type of icons that graphically matches your "
               "Workbench."
				)
			)
			(
            (set kickflag 1)
			)
			(
            (set kickflag 0)
			)
		)
   )
   (
	   (set libflag 65535)
		(if (>= osversion 36)
			(
            (set kickflag 1)
			)
      )
		(if (<= osversion 35)
			(
            (set kickflag 0)
			)
      )
   )
)

(onerror
   (abort
      "DiskExpander cannot be installed successfully "
      "because the compression libraries cannot be copied to the "
      "target device!\n\n"
      "Please ensure that there's enough space on the hard disk before "
      "starting onother attempt to install the program.\n"
	)
)

(if (IN libflag 0)
   (copylib
   	(prompt "" )
   	(help "")
   	(source "DiskExpander:libs/epu0.library")
   	(dest "libs:")
   )
)

(complete 5)

(if (IN libflag 1)
   (copylib
   	(prompt "" )
   	(help "")
   	(source "DiskExpander:libs/epu1.library")
   	(dest "libs:")
   )
)

(complete 10)

(if (IN libflag 2)
   (copylib
   	(prompt "" )
   	(help "")
   	(source "DiskExpander:libs/xpkNUKE.library")
   	(dest "libs:")
   )
)

(complete 15)

(if (IN libflag 3)
   (copylib
   	(prompt "" )
   	(help "")
   	(source "DiskExpander:libs/xpkBLZW.library")
   	(dest "libs:")
   )
)

(complete 20)

(if (IN libflag 4)
   (copyfiles
   	(prompt "" )
   	(help "")
   	(source "DiskExpander:libs/xpkFAST.library")
   	(dest "libs:")
   )
)

(complete 25)

(if (IN libflag 5)
   (copylib
   	(prompt "" )
   	(help "")
   	(source "DiskExpander:libs/xpkSHRI.library")
   	(dest "libs:")
   )
)

(complete 30)

(onerror
   (abort
      "DiskExpander cannot be installed successfully "
      "because the handler files cannot be copied to the "
      "target device!\n\n"
      "Please ensure that there's enough space on the hard disk before "
      "starting onother attempt to install the program.\n"
	)
)

(copyfiles
	(prompt "" )
	(help "")
	(source "DiskExpander:l")
	(dest "l:")
   (pattern "DE#?-handler")
)

(complete 40)

(onerror
   (abort
      "DiskExpander cannot be installed successfully "
      "because the main program and the utilites cannot be copied to the "
      "target device!\n\n"
      "Please ensure that there's enough space on the hard disk before "
      "starting onother attempt to install the program.\n"
	)
)

(copyfiles
	(prompt "" )
	(help "")
	(source "DiskExpander:c/DiskExpander")
	(dest "c:")
)

(complete 60)

(copyfiles
	(prompt "" )
	(help "")
	(source "DiskExpander:InstallData/ProgramData")
	(dest realdest)
   (pattern "#?")
)

(complete 75)

(if (= kickflag 0)
   (set sourcedir "DiskExpander:InstallData/Icons1.3")
)

(if (= kickflag 1)
   (set sourcedir "DiskExpander:InstallData/Icons2.0")
)

(copyfiles
	(prompt "" )
	(help "")
	(source sourcedir)
	(dest realdest)
   (all)
)

(complete 95)

(message
   "\n\n\n\nIf you've not already done this, you should now"
   "\n\n write-protect your original program disk!"
)

(run "DiskExpander:c/DiskExpander protect")

(complete 100)
(exit
   
   "DiskExpander is now ready to be started from the hard disk. "
   "To do this, simply run the main program stored in the newly \n\n"
   "created directory. The original program disk is no longer needed. "
   "Please keep it in a secure place."
)

