;;$Header$
;; SRT_TEMP.SCR version 3.0    06 MAY 94   10:00:00
;; Omnis 7 SQL Runtime Version 3 Installation Template (Rename to TEMPLATE.SCR before use)
;; ***** CHANGES *****
;; 
;; *******************

;; ################ Startup and General Procedures #################

;; **** Startup Procedure ****
PROCEDURE ("Startup")
	;; ** Platform dependand veriables **
	Var(o7mask="*.EXE")
	if (%_platform="M") %o7mask="O7$3APPL"
	
	;; ** Declare variables used throughout **
	Var(chk0=1,chk1=0,chk2=0,chk3=0,chk4=1,chk5=1,chk6=0,chk7=1,chk8=0,chk9=0,spaceRequired=0)
	Var(isInstall=0, isOK=0, err=0,connectsSize=500,omnisSize=500,origOmnisSize=6000,omnisSizeInc=500)
	Var(installTitle="Omnis 7 V3.0 SQL Runtime Installation", updateTitle="Omnis 7 V3.0 SQL Runtime Update")
	
	Dialog(dlgAbout,3)
	do("CheckHardware")
	do("Set SpaceRequired")
	do("AdvancedInstallation")
	ON (open)
		;; ** Set text for dialog items here **
		SetDlgItemText(2,%installTitle)
ENDPROC


;; **** Check the hardware against minimum requirements ****
PROCEDURE ("CheckHardware")
	VAR(processor=0,ramsize=0)
	GetHardware(%processor,%ramsize)
	if (%_platform="M") do("CheckProcessorMAC")
	if (%_platform="W") do("CheckProcessorWIN")
	if (%ramsize<6) Query("WARNING! It is recommended that your machine has 6 mega bytes of RAM to use Omnis efficiently. Do you wish to continue?")
	ON (no)
		quit
ENDPROC

PROCEDURE ("CheckProcessorMAC")
	if (%processor<3) Message("You can not use Omnis 7 on this machine. You need a machine with a 68020 processor or better.")
	if (%processor<3) Quit
ENDPROC

PROCEDURE ("CheckProcessorWIN")
	if (%processor & 2) Message("It is recommended that you use a 386 or higher machine.")
ENDPROC


;; **** ABOUT Procedure ****
PROCEDURE ("ABOUT")
	Dialog(dlgAbout)
	ON (open)
		;; ** Set text for dialog items here **
		SetDlgItemText(2,%installTitle)
ENDPROC


;; **** This procedure handles installation errors ****
PROCEDURE ("Errors")
  ON (2)
		Message("A file could not be found by DOS - The disk may be damaged.")
  ON (3)
		Message("A path could not be found by DOS - The disk may be damaged.")
  ON (4)
		Message("Dos has run out of file-handles. Please check your CONFIG.SYS file.")
	ON (-34)
		Message("The Disk space has been exhausted. Try creating some more space and re-run the installation.")
	ON (-36)
		Message("An I/O error has occurred. The Disks may be damaged.")
	ON (-45,5)
		Message("An attempt was made to write to or delete a locked file. Make sure all files in your Destination folder are unlocked and re-run the installation.")
ENDPROC


;; ################ Advanced Installation Procedures #################

;; **** This Procedure handles the main window for the advanced installation ****
PROCEDURE ("AdvancedInstallation")
	;; ** declare constants for dialog items **
	Const(cnInstallTxt=1, cnUpdateTxt=2, cnQuitTxt=5)
	Const(cnInstall=6, cnUpdate=7, cnSpare1=8, cnSpare2=9, cnQuit=10)
	
	;; ** Initialise Installer globals for serial number **
	Set(platform,%_platform)
	Set(productType,"")
	Set(filemask,"")
	Set(groupName,"Omnis 7 Programs")
	Set(iconName,"Omnis7 V3.0")
	Set(progName,"OMNIS7.EXE")
	Set(AddIcon,"-")
	
	;; ** Open the Dialog **
	Dialog(dlgMain)
	
	;; ** set text for dialog and items **
	ON (open)
		SetDlgItemText(title,%installTitle)
		SetDlgItemText(cnInstallTxt,"To Install Omnis 7 for the first time")
		SetDlgItemText(cnUpdateTxt,"To update an existing Omnis 7 Version 3")
		SetDlgItemText(cnQuitTxt,"To quit Installation")
		SetDlgItemText(cnInstall,"Install")
		SetDlgItemText(cnUpdate,"Update")
		SetDlgItemText(cnQuit,"Quit")
		HideDlgItem(cnSpare1)
		HideDlgItem(cnSpare2)
			
	;; ** The Install button has been hit **
	ON (cnInstall)
		%isInstall=1
		do("OptionsDialog")
		
	;; ** The Update button has been hit **
	ON (cnUpdate)
		%isInstall=0
	 	do("OptionsDialog")
		
	;; ** The Quit button has been hit **
	ON (cnQuit)
		quit
ENDPROC


;; **** This Procedure handles the options dialog ****
PROCEDURE ("OptionsDialog")

	;; ** Dialog IDs for dialog , ok and cancel **
	Const(dlgOptions=1001, cnOk=1, cnCancel=2)

	;; ** Dialog IDs for personal Information **
	Const(cnUserText=3, cnCompanyText=4, cnSerialText=5, cnUser=6, cnCompany=7, cnSerial=8)
	Const(cnPersBox=9, cnPersText=10, cnPersNotes=44)

	;; ** Dialog IDs for checkboxes **
	Const(cnCHK0=11, cnCHK1=12, cnCHK2=13, cnCHK3=14, cnCHK4=15, cnCHK5=16, cnCHK6=17, cnCHK7=18, cnCHK8=19, cnCHK9=20)
	Const(cnSpaceText=21, cnSpace=22, cnCHKBox=23, cnCHKBoxText=24)

  ;; ** Dialog IDs for setting memory sizes **
	Const(cnOmText=25,cnOmSize1=26, cnOmSize2=27, cnOmSize3=28, cnOmSize4=29, cnOmSize5=30, cnOmSize6=31, cnOmTotal=32)
	Const(cnCoText=33, cnCoSize1=34, cnCoSize2=35, cnCoSize3=36, cnCoSize4=37, cnCoSize5=38, cnCoSize6=39, cnCoTotal=40)
	Const(cnMemBox=41, cnMemText=42, cnRetrieve=43)
	
	;; ** Some variables needed for dialog logic **
	Var(itemHit, showOmnisSizeButt, showConnectsSizeButt, omnisSizeButt, connectsSizeButt, tmp="", tmp1="", tmp2="")
	
	;; ** Open the dialog **
	Dialog(dlgOptions)
	
	;; ** set the text and initial values of dialog items **
	ON (open)
	  do("OptionsOpen")
	
	;; ** deal with clicks on the checkboxes **
	ON (%_mode * ((%_mode>=cnCHK0) & (%_mode<=cnCHK9)))
		;; ** Must NOT allow all check boxes to be deselected **
		%err=($cnCHK0+$cnCHK1+$cnCHK2+$cnCHK3+$cnCHK4+$cnCHK5+$cnCHK6+$cnCHK7+$cnCHK8+$cnCHK9)
		if (%err=0) Message("You must at least have one checkbox checked...")
		if (%err=0) SetDlgItemValue(%_mode,1);
	  ;; ** transfere checkbox values to chk variables for "Set SpaceRequired" procedure **
		%chk0=$cnCHK0
		%chk1=$cnCHK1
		%chk2=$cnCHK2
		%chk3=$cnCHK3
		%chk4=$cnCHK4
		%chk5=$cnCHK5
		%chk6=$cnCHK6
		%chk7=$cnCHK7
		%chk8=$cnCHK8
		%chk9=$cnCHK9
		do("Set SpaceRequired")
		SetDlgItemText(cnSpace,%spaceRequired+"kb")
		;; ** Hide or Show Memory buttons according to checkbox settings **
		%itemHit=%_mode
		if (%_platform="M") do("HideShowMemoryButtons")
	
	;; ** deal with clicks on the omnis memory buttons **
	ON (%_mode * ((%_mode>=cnOmSize1) & (%_mode<=cnOmSize6)))
		%err=( %showConnectsSizeButt & ((%_mode-cnOmSize1)<(%connectsSizeButt-cnCoSize1)) )
		IfNot (%err) %omnisSizeButt=%_mode
		IfNot (%err) SetDlgItemText(cnOmTotal,((%omnisSizeButt-cnOmSize1)*%omnisSizeInc+%origOmnisSize)+"kb")
		If (%err) Message("You must give Omnis the same or more memory then you give to Sybase.")
		If (%err) SetDlgItemValue(%omnisSizeButt,1)
	
	;; ** deal with clicks on the connects memory buttons	**	
	ON (%_mode * ((%_mode>=cnCoSize1) & (%_mode<=cnCoSize6)))
		%connectsSizeButt=%_mode
		SetDlgItemText(cnCoTotal,(%connectsSizeButt-cnCoSize1)*%omnisSizeInc+"kb")
	  %err=( (%omnisSizeButt-cnOmSize1) < (%connectsSizeButt-cnCoSize1) )
		If (%err) %omnisSizeButt=%connectsSizeButt-cnCoSize1+cnOmSize1
		If (%err) SetDlgItemValue(%omnisSizeButt,1)
		If (%err) SetDlgItemText(cnOmTotal,((%omnisSizeButt-cnOmSize1)*%omnisSizeInc+%origOmnisSize)+"kb")
		
	ON (cnUser, cnCompany, cnSerial)
		%tmp=$cnSerial
		%tmp1=$cnCompany
		%tmp2=$cnUser
		if (%isInstall) EnableDlgItem(cnOK, (%tmp[0]>0) & (%tmp1[0]>0) & (%tmp2[0]>0))
	
	ON (cnRetrieve)
		do("RetrieveDetails")
	
	;; ** Ok has been hit **	
	ON (cnOk)
	  ;; ** must check serial number if field is NOT empty **
		%err=0
		%tmp=$cnSerial
		if (%tmp[0]) CheckSerialNumber(%tmp,%err)
		if (%err>=1044) Message(%err)
		if (%err=0) do("OptionsCloseOk")
	
	;; ** Cancel has been hit **
	ON (cnCancel)
		do("OptionsCloseCancel")
ENDPROC


PROCEDURE ("RetrieveDetails")
	VAR(prefSize=0, minSize=0)
	Set(filemask,%o7mask)
	Dialog(dlgGetOmnis)
	ON (ok)
	  SetDlgItemText(cnUser,%_userName)
		SetDlgItemText(cnCompany,%_companyName)
		SetDlgItemText(cnSerial,%_serialNumber)
		EnableDlgItem(cnOK,1)
		if (%_platform="M") do("RetrieveDetailsMemory")
ENDPROC


PROCEDURE ("RetrieveDetailsMemory")
	GetMemoryModel(%_OldOmnis,%prefSize,%minSize)
	if (%minSize) %omnisSizeButt=(%prefSize-%origOmnisSize)/%omnisSizeInc+cnOmSize1
	%minSize=0
	GetMemoryModel(":Omnis Extensions:SQLServe Connect",%prefSize,%minSize)
	if (%minSize) %connectsSizeButt=%prefSize/%omnisSizeInc+cnCoSize1
	SetDlgItemValue(%omnisSizeButt,1)
	SetDlgItemValue(%connectsSizeButt,1)
	SetDlgItemText(cnOmTotal,((%omnisSizeButt-cnOmSize1)*%omnisSizeInc+%origOmnisSize)+"kb")
	SetDlgItemText(cnCoTotal,(%connectsSizeButt-cnCoSize1)*%omnisSizeInc+"kb")
ENDPROC


;; **** This procedure is called when the options window is opened ****
PROCEDURE ("OptionsOpen")
	;; ** these variables are used to preserve and restore the checkbox settings **
	Var(tchk0,tchk1,tchk2,tchk3,tchk4,tchk5,tchk6,tchk7,tchk8,tchk9,tspaceRequired)

	;; ** set window title **
	if (%isInstall) SetDlgItemText(title,%installTitle)
	ifNot (%isInstall) SetDlgItemText(title,%updateTitle)
	
	;; ** setup ok button **
	if (%isInstall) SetDlgItemText(cnOk,"Install")
	ifNot (%isInstall) SetDlgItemText(cnOk,"Update")
	EnableDlgItem(cnOK,(%isInstall=0) | ((%_userName[0]>0) & (%_companyName[0]>0) & (%_serialNumber[0]>0)))
	
	;; ** setup cancel and retrieve buttons **
	SetDlgItemText(cnCancel,"Cancel")	
	SetDlgItemText(cnRetrieve,"Retrieve Details")
	HideDlgItem(cnRetrieve,%isInstall)
	
	;; ** set personal Information items text **
	SetDlgItemText(cnUserText,"User Name:")
	SetDlgItemText(cnCompanyText,"Company Name:")
	SetDlgItemText(cnSerialText,"Serial Number:")
	if (%isInstall) SetDlgItemText(cnUser,%_userName)
	if (%isInstall) SetDlgItemText(cnCompany,%_companyName)
	if (%isInstall) SetDlgItemText(cnSerial,%_serialNumber)
	if (%isInstall) SetDlgItemText(cnPersText," Serialization Details ")
	ifNot (%isInstall) SetDlgItemText(cnPersText," Serialization Notes ")
	SetDlgItemText(cnPersNotes,"The Serialization details from your old Omnis will be transferred to your new Omnis.")
	
	HideDlgItem(cnUserText,%isInstall)
	HideDlgItem(cnCompanyText,%isInstall)
	HideDlgItem(cnSerialText,%isInstall)
	HideDlgItem(cnUser,%isInstall)
	HideDlgItem(cnCompany,%isInstall)
	HideDlgItem(cnSerial,%isInstall)
	HideDlgItem(cnPersNotes,%isInstall=0)

	EnableDlgItem(cnUser,%isInstall)
	EnableDlgItem(cnCompany,%isInstall)
	EnableDlgItem(cnSerial,%isInstall)
	
	;; ** set checkbox text **
	SetDlgItemText(cnCHK0,"Omnis 7")
	SetDlgItemText(cnCHK1,"Help file for reporting")
	SetDlgItemText(cnCHK2,"SQL Vendor Files")
	SetDlgItemText(cnSpaceText,"Space Required:")
	if (%_platform="M") SetDlgItemText(cnCHKBoxText," Installation Options ")
	if (%_platform="W") SetDlgItemText(cnCHKBox," Installation Options ")
	do("Set SpaceRequired")
	SetDlgItemText(cnSpace,%spaceRequired+"kb")
	
	;; ** set checkbox values **
	SetDlgItemValue(cnCHK0,%chk0 | %isInstall)
	SetDlgItemValue(cnCHK1,%chk1)
	SetDlgItemValue(cnCHK2,%chk2)
	EnableDlgItem(cnCHK0,%isInstall=0)
	
	;; ** hide unused checkboxes **
	HideDlgItem(cnCHK3)
	HideDlgItem(cnCHK4)
	HideDlgItem(cnCHK5)
	HideDlgItem(cnCHK6)
	HideDlgItem(cnCHK7)
	HideDlgItem(cnCHK8)
	HideDlgItem(cnCHK9)
	
	;; ** save checkbox settings **
	%tchk0=%chk0
	%tchk1=%chk1
	%tchk2=%chk2
	%tchk3=%chk3
	%tchk4=%chk4
	%tchk5=%chk5
	%tchk6=%chk6
	%tchk7=%chk7
	%tchk8=%chk8
	%tchk9=%chk9
	%tspaceRequired=%spaceRequired
	
	if (%_platform="M") do("OptionsOpenMem")
ENDPROC


PROCEDURE ("OptionsOpenMem")
	;; ** set memory buttons text **
	SetDlgItemText(cnOmText,"Omnis 7")
	SetDlgItemText(cnCoText,"Sybase")
	SetDlgItemText(cnMemText," Memory sizes: ")
	
  ;; ** setup memory buttons **
	%showOmnisSizeButt=%chk0 | %isInstall
	%showConnectsSizeButt=%chk5
	if (%showConnectsSizeButt & (%omnisSize < %connectsSize)) %omnisSize=%connectsSize
	%omnisSizeButt=%omnisSize/%omnisSizeInc+cnOmSize1
	%connectsSizeButt=%connectsSize/%omnisSizeInc+cnCoSize1
	SetDlgItemValue(%omnisSizeButt,1)
	SetDlgItemValue(%connectsSizeButt,1)
	SetDlgItemText(cnOmTotal,((%omnisSizeButt-cnOmSize1)*%omnisSizeInc+%origOmnisSize)+"kb")
	SetDlgItemText(cnCoTotal,(%connectsSizeButt-cnCoSize1)*%omnisSizeInc+"kb")
	do("HideShowOmnisMemoryButtons")
	do("HideShowConnectsMemoryButtons")
ENDPROC


;; **** This procedure is called when the OK button is hit on the options window ****
PROCEDURE ("OptionsCloseOK")
	;; ** save Personal details **
	if (%isInstall) %_userName=$cnUser
	if (%isInstall) %_companyName=$cnCompany
	if (%isInstall) %_serialNumber=$cnSerial

	;; ** save checkbox values **
	%chk0=$cnCHK0
	%chk1=$cnCHK1
	%chk2=$cnCHK2
	%chk3=$cnCHK3
	%chk4=$cnCHK4
	%chk5=$cnCHK5
	%chk6=$cnCHK6
	%chk7=$cnCHK7
	%chk8=$cnCHK8
	%chk9=$cnCHK9
	
	;; ** save memory sizes **
	if (%_platform="M") %omnisSize=(%omnisSizeButt-cnOmSize1)*%omnisSizeInc
	if (%_platform="M") %connectsSize=(%connectsSizeButt-cnCoSize1)*%omnisSizeInc
	
	SpaceRequired(%spaceRequired)
	if (%isInstall) do("AdvancedInstallPickDest")
	ifNot (%isInstall) do("AdvancedUpdatePickDest")
	if (%isOK) CloseDialog
	if (%isOK & %isInstall) do("AdvancedInstall")
	if (%isOK & (%isInstall=0)) do("AdvancedUpdate")
	if (%isOK & (%_platform="M") & %chk3) Message("Omnis Graphs requires Apple's Shared Library Manager. If your System does not include it, please install it from the 'aslm' folder on this CD")
	if (%isOK & (%_platform="W")) Message("A set of cross-platform font files have been copied to your OMNIS7\FONTS directory. Please use the control panel Font utility to install them into your system.")
	
ENDPROC


;; **** This procedure is called when the Cancel button is hit on the options window ****
PROCEDURE ("OptionsCloseCancel")
	;; ** restore checkbox settings **
	%chk0=%tchk0
	%chk1=%tchk1
	%chk2=%tchk2
	%chk3=%tchk3
	%chk4=%tchk4
	%chk5=%tchk5
	%chk6=%tchk6
	%chk7=%tchk7
	%chk8=%tchk8
	%chk9=%tchk9
	%spaceRequired=%tspaceRequired
	
	SpaceRequired(%spaceRequired)
	CloseDialog
	%isOK=0
ENDPROC


PROCEDURE ("HideShowMemoryButtons")
	;; ** Hide or Show Memory buttons according to checkbox settings **
	if (%itemHit=cnCHK0) %showOmnisSizeButt=%chk0 | %isInstall
	if (%itemHit=cnCHK0) do("HideShowOmnisMemoryButtons")
	if (%itemHit=cnCHK5) %showConnectsSizeButt=$cnCHK5
	if (%itemHit=cnCHK5) do("HideShowConnectsMemoryButtons")
	%err=( %showConnectsSizeButt & ((%omnisSizeButt-cnOmSize1)<(%connectsSizeButt-cnCoSize1)) )
	If (%err) %omnisSizeButt=%connectsSizeButt-cnCoSize1+cnOmSize1
	If (%err) SetDlgItemValue(%omnisSizeButt,1)
	If (%err) SetDlgItemText(cnOmTotal,((%omnisSizeButt-cnOmSize1)*%omnisSizeInc+%origOmnisSize)+"kb")
ENDPROC


;; **** This procedure hides or shows the Omnis Memory buttons ****
PROCEDURE ("HideShowOmnisMemoryButtons")
	HideDlgItem(cnOmText,%showOmnisSizeButt)
	HideDlgItem(cnOmSize1,%showOmnisSizeButt)
	HideDlgItem(cnOmSize2,%showOmnisSizeButt)
	HideDlgItem(cnOmSize3,%showOmnisSizeButt)
	HideDlgItem(cnOmSize4,%showOmnisSizeButt)
	HideDlgItem(cnOmSize5,%showOmnisSizeButt)
	HideDlgItem(cnOmSize6,%showOmnisSizeButt)
	HideDlgItem(cnOmTotal,%showOmnisSizeButt)
	HideDlgItem(cnMemBox,(%showOmnisSizeButt | %showConnectsSizeButt))
	HideDlgItem(cnMemText,(%showOmnisSizeButt | %showConnectsSizeButt))
ENDPROC


;; **** This procedure hides or shows the Connects Memory buttons ****
PROCEDURE ("HideShowConnectsMemoryButtons")
	HideDlgItem(cnCoText,%showConnectsSizeButt)
	HideDlgItem(cnCoSize1) ;; never used
	HideDlgItem(cnCoSize2,%showConnectsSizeButt)
	HideDlgItem(cnCoSize3,%showConnectsSizeButt)
	HideDlgItem(cnCoSize4,%showConnectsSizeButt)
	HideDlgItem(cnCoSize5,%showConnectsSizeButt)
	HideDlgItem(cnCoSize6,%showConnectsSizeButt)
	HideDlgItem(cnCoTotal,%showConnectsSizeButt)
	HideDlgItem(cnMemBox,(%showOmnisSizeButt | %showConnectsSizeButt))
	HideDlgItem(cnMemText,(%showOmnisSizeButt | %showConnectsSizeButt))
ENDPROC



;; **** This Procedure handles the install dialog ****
PROCEDURE ("AdvancedInstallPickDest")
	Const(cnFileName=13)
	;; ** Open the dialog **
	Dialog(dlgInstall)
	
	ON (open)
		;; ** Set text for dialog items here **
		Set(AddIcon,"+")
		if (%_platform="W") SetDlgItemText(cnFileName,"C:\OMNIS7")
	
	;; ** Ok has been hit , continue with installation **
	ON (ok)
		%isOK=(%_mode=ok)
  ON (cancel)
     %isOK=0
     Set(AddIcon, "-")
ENDPROC


PROCEDURE ("AdvancedInstall")
	WorkingMessage
	do("Unpack Files")
	if (%_platform="M") do("SetMemoryModel")
	CloseWorkingMessage
	
	;; ** an error has occurred during the installation **
	ON (error)
		DoError("Errors")
		Message("Due to an error, the installation is aborted. All files installed so far will be removed")
		do ("Delete Files")
			
	;; ** the user has interrupted the installation **
	ON (break)
		Message("Aborting installation. All files installed so far will be removed")
		do ("Delete Files")
ENDPROC


;; **** This Procedure handles the update dialog ****
PROCEDURE ("AdvancedUpdatePickDest")
	;; ** prepare for update **
	Set(filemask,%o7mask)
	
	;; ** Open the dialog **
	Dialog(dlgUpdate)
	
	ON (open)
		;; ** Set text for dialog items here **
		Set(AddIcon,"-")
		if (%_platform="W") SetDlgItemText(cnFileName,"C:\OMNIS7")
	
	;; ** Ok has been hit , continue with update **
	ON (ok,cancel)
		%isOK=(%_mode=ok)
ENDPROC


PROCEDURE ("AdvancedUpdate")
	WorkingMessage("Updating...")
	do("Unpack Files")
	if (%_platform="M") do("SetMemoryModel")
	CloseWorkingMessage
		
	;; ** an error has occurred during the update **
	ON (error)
		DoError("Errors")
		Message("Due to an error, the update is aborted. Files already installed may be corrupted.")
		;; NOTE: You should never delete files on an update...
		
	;; ** the user has interrupted the update **
	ON (break)
		Message("Aborting Update. Files already installed may be corrupted.")
		;; NOTE: You should never delete files on an update...
ENDPROC


PROCEDURE ("SetMemoryModel")
	if (%chk0 | %chk5) WorkingMessage("Setting Memory Model...")
	if (%chk0) SetMemoryModel("Omnis 7",%omnisSize+%origOmnisSize)
	if (%chk5) SetMemoryModel(":Omnis Extensions:SQLServe DAM",%connectsSize)
ENDPROC


;; ################ Make Masters Procedures #################
;;
;; Three routines will be appended here by the Make Masters command.
;;
;; 1) "Unpack Files" which contains all commands to unpack files and create directories.
;; 2) "Delete Files" which removes files and directories if an error occurs during an
;;    Installation.
;; 3) "Set SpaceRequired" which will be called by "Install", "Update" and "Options" procedures
;;    to set the space required, for the files about to be installed.



PROCEDURE ("Unpack Files")
  Set(destination,"%D")
  IF (%chk0)   CreateDirectory("EXTERNAL",useExisting)
  IF (%chk0)   CreateDirectory("\EXTERNAL\UNUSED",useExisting)
  IF (%chk0)   CreateDirectory("\EXTERNAL\APPLETS",useExisting)
  IF (%chk0)   CreateDirectory("FONTS",useExisting)
  IF (%chk0)   CreateDirectory("SAMPLEXT",useExisting)
  IF (%chk0)   CreateDirectory("\SAMPLEXT\MSMAIL",useExisting)
  IF (%chk0)   CreateDirectory("\SAMPLEXT\QWKTIME",useExisting)
  IF (%chk2)   CreateDirectory("SQLUTILS",useExisting)
  IF (%chk2)   CreateDirectory("\SQLUTILS\VENAPI",useExisting)
  IF (%chk2)   CreateDirectory("\SQLUTILS\VENAPI\EDA",useExisting)
  IF (%chk2)   CreateDirectory("\SQLUTILS\VENAPI\ODBC",useExisting)
  IF (%chk2)   CreateDirectory("\SQLUTILS\VENAPI\ORACLE",useExisting)
  IF (%chk2)   CreateDirectory("\SQLUTILS\VENAPI\RDB",useExisting)
  IF (%chk0)   Copy("Please insert the Disk: SR1","README1.TXT","README1.TXT")
  IF (%chk0)   Copy("Please insert the Disk: SR1","README2.TXT","README2.TXT")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\UNUSED.TXT","\EXTERNAL\UNUSED\UNUSED.TXT")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\NOTES2O7.DLL","\EXTERNAL\UNUSED\NOTES2O7.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\STRIP.DLL","\EXTERNAL\UNUSED\STRIP.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\REPLACE.DLL","\EXTERNAL\UNUSED\REPLACE.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\ORA6WIN.DLL","\EXTERNAL\UNUSED\ORA6WIN.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\ORACLE2.DLL","\EXTERNAL\UNUSED\ORACLE2.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\ORACLE7.DLL","\EXTERNAL\UNUSED\ORACLE7.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\SQLINK.DLL","\EXTERNAL\UNUSED\SQLINK.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\UNUSED\SQLSERVE.DLL","\EXTERNAL\UNUSED\SQLSERVE.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\APPLETS\OMNISOLE.DLL","\EXTERNAL\APPLETS\OMNISOLE.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\CALLDLL.DLL","\EXTERNAL\CALLDLL.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\DATEFNC.DLL","\EXTERNAL\DATEFNC.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\LISTFNC.DLL","\EXTERNAL\LISTFNC.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\COOLBTN.DLL","\EXTERNAL\COOLBTN.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\OMNISSQL.DLL","\EXTERNAL\OMNISSQL.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\O7HELP.DLL","\EXTERNAL\O7HELP.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\FILEOPS.DLL","\EXTERNAL\FILEOPS.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\CHARFNC.DLL","\EXTERNAL\CHARFNC.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\GETFILES.DLL","\EXTERNAL\GETFILES.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\FONTFNC.DLL","\EXTERNAL\FONTFNC.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\GRAPHS.DLL","\EXTERNAL\GRAPHS.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\INGRES.DLL","\EXTERNAL\INGRES.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\O7INFORM.DLL","\EXTERNAL\O7INFORM.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\ORACLE.DLL","\EXTERNAL\ORACLE.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\SQLSERVE.DLL","\EXTERNAL\SQLSERVE.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\O7DAL.DLL","\EXTERNAL\O7DAL.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR1","EXTERNAL\SQLINK.DLL","\EXTERNAL\SQLINK.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","EXTERNAL\SQLINK.D%1")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","EXTERNAL\O7RDB.DLL","\EXTERNAL\O7RDB.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","EXTERNAL\O7EDA.DLL","\EXTERNAL\O7EDA.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","EXTERNAL\O7ODBC.DLL","\EXTERNAL\O7ODBC.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","FONTS\O7_LIST.FON","\FONTS\O7_LIST.FON")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","FONTS\O7_PSWD.FON","\FONTS\O7_PSWD.FON")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","FONTS\O7_SYSTM.FON","\FONTS\O7_SYSTM.FON")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","FONTS\O7_TABLE.FON","\FONTS\O7_TABLE.FON")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\MSMAIL\MSMAIL.DF1","\SAMPLEXT\MSMAIL\MSMAIL.DF1")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\MSMAIL\MSMAIL.DLL","\SAMPLEXT\MSMAIL\MSMAIL.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\MSMAIL\MSMAIL.LBR","\SAMPLEXT\MSMAIL\MSMAIL.LBR")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\HARDWARE.RTF","\SAMPLEXT\QWKTIME\HARDWARE.RTF")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\MCENU.HLP","\SAMPLEXT\QWKTIME\MCENU.HLP")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QCMC.DLL","\SAMPLEXT\QWKTIME\QCMC.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QT.DLL","\SAMPLEXT\QWKTIME\QT.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTDEMO.LBR","\SAMPLEXT\QWKTIME\QTDEMO.LBR")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTIM.DLL","\SAMPLEXT\QWKTIME\QTIM.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTIMCMGR.DLL","\SAMPLEXT\QWKTIME\QTIMCMGR.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTJPEG.DLL","\SAMPLEXT\QWKTIME\QTJPEG.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTNOTIFY.EXE","\SAMPLEXT\QWKTIME\QTNOTIFY.EXE")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTRAW.DLL","\SAMPLEXT\QWKTIME\QTRAW.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTRLE.DLL","\SAMPLEXT\QWKTIME\QTRLE.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTRPZA.DLL","\SAMPLEXT\QWKTIME\QTRPZA.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\QTSMC.DLL","\SAMPLEXT\QWKTIME\QTSMC.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR2","SAMPLEXT\QWKTIME\SAMPLE.MOV","\SAMPLEXT\QWKTIME\SAMPLE.MOV")
  IF (%chk2)   Unpack("Please insert the Disk: SR2","SQLUTILS\VENAPI\EDA\EDAWN3.DLL","\SQLUTILS\VENAPI\EDA\EDAWN3.DLL")
  IF (%chk2)   Unpack("Please insert the Disk: SR2","SQLUTILS\VENAPI\ODBC\ODBC.DLL","\SQLUTILS\VENAPI\ODBC\ODBC.DLL")
  IF (%chk2)   Unpack("Please insert the Disk: SR2","SQLUTILS\VENAPI\ORACLE\COREWIN.DLL","\SQLUTILS\VENAPI\ORACLE\COREWIN.DLL")
  IF (%chk2)   Unpack("Please insert the Disk: SR2","SQLUTILS\VENAPI\ORACLE\ORA7WIN.DLL","\SQLUTILS\VENAPI\ORACLE\ORA7WIN.DLL")
  IF (%chk2)   Unpack("Please insert the Disk: SR3","SQLUTILS\VENAPI\ORACLE\ORA7WIN.D%1")
  IF (%chk2)   Unpack("Please insert the Disk: SR3","SQLUTILS\VENAPI\RDB\SQSAPIW.DLL","\SQLUTILS\VENAPI\RDB\SQSAPIW.DLL")
  IF (%chk2)   Unpack("Please insert the Disk: SR3","SQLUTILS\CHARED.EXE","\SQLUTILS\CHARED.EXE")
  IF (%chk1)   Unpack("Please insert the Disk: SR3","ADHOC.HLP","ADHOC.HLP")
  IF (%chk0)   Unpack("Please insert the Disk: SR3","OMNIS7.EXE","OMNIS7.EXE")
  IF (%chk0)   Unpack("Please insert the Disk: SR4","OMNIS7.E%1")
  Serialise("OMNIS7.EXE")
  IF (%chk0)   Unpack("Please insert the Disk: SR4","OMNISRES.DLL","OMNISRES.DLL")
  IF (%chk0)   Unpack("Please insert the Disk: SR4","OMNISPIC.DF1","OMNISPIC.DF1")
  IF (%chk0)   Unpack("Please insert the Disk: SR5","OMNISPIC.D%1")
  IF (%chk0)   Unpack("Please insert the Disk: SR5","TEMPLATE.REP","TEMPLATE.REP")
  IF (%chk0)   Unpack("Please insert the Disk: SR5","DGDSC.DLL","DGDSC.DLL")
ENDPROC

PROCEDURE ("Delete Files")
  Delete("README1.TXT",ignoreError)
  Delete("README2.TXT",ignoreError)
  Delete("\EXTERNAL\UNUSED\UNUSED.TXT",ignoreError)
  Delete("\EXTERNAL\UNUSED\NOTES2O7.DLL",ignoreError)
  Delete("\EXTERNAL\UNUSED\STRIP.DLL",ignoreError)
  Delete("\EXTERNAL\UNUSED\REPLACE.DLL",ignoreError)
  Delete("\EXTERNAL\UNUSED\ORA6WIN.DLL",ignoreError)
  Delete("\EXTERNAL\UNUSED\ORACLE2.DLL",ignoreError)
  Delete("\EXTERNAL\UNUSED\ORACLE7.DLL",ignoreError)
  Delete("\EXTERNAL\UNUSED\SQLINK.DLL",ignoreError)
  Delete("\EXTERNAL\UNUSED\SQLSERVE.DLL",ignoreError)
  Delete("\EXTERNAL\APPLETS\OMNISOLE.DLL",ignoreError)
  Delete("\EXTERNAL\CALLDLL.DLL",ignoreError)
  Delete("\EXTERNAL\DATEFNC.DLL",ignoreError)
  Delete("\EXTERNAL\LISTFNC.DLL",ignoreError)
  Delete("\EXTERNAL\COOLBTN.DLL",ignoreError)
  Delete("\EXTERNAL\OMNISSQL.DLL",ignoreError)
  Delete("\EXTERNAL\O7HELP.DLL",ignoreError)
  Delete("\EXTERNAL\FILEOPS.DLL",ignoreError)
  Delete("\EXTERNAL\CHARFNC.DLL",ignoreError)
  Delete("\EXTERNAL\GETFILES.DLL",ignoreError)
  Delete("\EXTERNAL\FONTFNC.DLL",ignoreError)
  Delete("\EXTERNAL\GRAPHS.DLL",ignoreError)
  Delete("\EXTERNAL\INGRES.DLL",ignoreError)
  Delete("\EXTERNAL\O7INFORM.DLL",ignoreError)
  Delete("\EXTERNAL\ORACLE.DLL",ignoreError)
  Delete("\EXTERNAL\SQLSERVE.DLL",ignoreError)
  Delete("\EXTERNAL\O7DAL.DLL",ignoreError)
  Delete("\EXTERNAL\SQLINK.DLL",ignoreError)
  Delete("\EXTERNAL\O7RDB.DLL",ignoreError)
  Delete("\EXTERNAL\O7EDA.DLL",ignoreError)
  Delete("\EXTERNAL\O7ODBC.DLL",ignoreError)
  Delete("\FONTS\O7_LIST.FON",ignoreError)
  Delete("\FONTS\O7_PSWD.FON",ignoreError)
  Delete("\FONTS\O7_SYSTM.FON",ignoreError)
  Delete("\FONTS\O7_TABLE.FON",ignoreError)
  Delete("\SAMPLEXT\MSMAIL\MSMAIL.DF1",ignoreError)
  Delete("\SAMPLEXT\MSMAIL\MSMAIL.DLL",ignoreError)
  Delete("\SAMPLEXT\MSMAIL\MSMAIL.LBR",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\HARDWARE.RTF",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\MCENU.HLP",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QCMC.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QT.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTDEMO.LBR",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTIM.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTIMCMGR.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTJPEG.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTNOTIFY.EXE",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTRAW.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTRLE.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTRPZA.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\QTSMC.DLL",ignoreError)
  Delete("\SAMPLEXT\QWKTIME\SAMPLE.MOV",ignoreError)
  Delete("\SQLUTILS\VENAPI\EDA\EDAWN3.DLL",ignoreError)
  Delete("\SQLUTILS\VENAPI\ODBC\ODBC.DLL",ignoreError)
  Delete("\SQLUTILS\VENAPI\ORACLE\COREWIN.DLL",ignoreError)
  Delete("\SQLUTILS\VENAPI\ORACLE\ORA7WIN.DLL",ignoreError)
  Delete("\SQLUTILS\VENAPI\RDB\SQSAPIW.DLL",ignoreError)
  Delete("\SQLUTILS\CHARED.EXE",ignoreError)
  Delete("ADHOC.HLP",ignoreError)
  Delete("OMNIS7.EXE",ignoreError)
  Delete("OMNISRES.DLL",ignoreError)
  Delete("OMNISPIC.DF1",ignoreError)
  Delete("TEMPLATE.REP",ignoreError)
  Delete("DGDSC.DLL",ignoreError)
  Delete("\SQLUTILS\VENAPI\RDB",ignoreError)
  Delete("\SQLUTILS\VENAPI\ORACLE",ignoreError)
  Delete("\SQLUTILS\VENAPI\ODBC",ignoreError)
  Delete("\SQLUTILS\VENAPI\EDA",ignoreError)
  Delete("\SQLUTILS\VENAPI",ignoreError)
  Delete("SQLUTILS",ignoreError)
  Delete("\SAMPLEXT\QWKTIME",ignoreError)
  Delete("\SAMPLEXT\MSMAIL",ignoreError)
  Delete("SAMPLEXT",ignoreError)
  Delete("FONTS",ignoreError)
  Delete("\EXTERNAL\APPLETS",ignoreError)
  Delete("\EXTERNAL\UNUSED",ignoreError)
  Delete("EXTERNAL",ignoreError)
  Delete("",ignoreError)
ENDPROC

PROCEDURE ("Set SpaceRequired")
  %spaceRequired=0
  if (%chk0) %spaceRequired=%spaceRequired+8056
  if (%chk1) %spaceRequired=%spaceRequired+24
  if (%chk2) %spaceRequired=%spaceRequired+1308
  SpaceRequired(%spaceRequired)
ENDPROC

