;;----------------------------------------------------------------------------
;; XFERPGM.INF
;; Yanked out of main script PS.INF (FullInstall)
;; in order to conserve max memory footprint
;;----------------------------------------------------------------------------

	[XferPgmErr] := NoCharacter


	;; Just to be safe, in case the user says No to setting up a printer:
	;; delete any existing PS.PDB.
	;; Pssible only in the event that the directory already existed, 
	;; but wasn't detected as being the home of PS.

	If FileExists PS.PDB
		DeleteFiles from [InstallationDirectory] Quietly
			PS.PDB
		EndDeleteFiles
	Endif



	;; For use during copying/transferring of que'd files
	LetButton <Esc> Do nothing
	LetButton <Esc> Do XferPgmEscape


	;; Paint screen:

	;; Do BackgroundWriteBegin
	;; I.E. - 
	SetShadows Off
	SetPopupBorderTo NONE
	SetPopupAttrTo  BlackOnCyan


	TextBox @XY( Center, 6 )
		"                                                        "
	EndTextBox

	TextBox @XY( Center, 5 )
		Installing program files...
	EndTextBox

	TextBox @xy(Center, 25)
		Press [Esc] to cancel installation.
	EndTextBox


	;; Do BackgroundWriteEnd
	;; I.E. -
	SetPopupAttrTo   LightCyanOnBlue
	SetPopupBorderTo SINGLE
	SetShadows On

	;; - - - - - - - - - - - - - - - - - - - - - -
	;; 10/18/1993
	;; Copy standalone README.TXT  *if* it exists
	;; 12/13/1993
	;; Copy standalone VERSION.DAT *if* it exists
	;; - - - - - - - - - - - - - - - - - - - - - -

	if FileExists [InstallFromDirectory]\[ReadmeFileName]
	    CopyFiles from [InstallFromDirectory] to [InstallationDirectory] Quietly
	        [ReadmeFileName]
	   EndCopyFiles
	endif

	if FileExists [InstallFromDirectory]\[VersionFileName]
	    CopyFiles from [InstallFromDirectory] to [InstallationDirectory] Quietly
	        [VersionFileName]
	   EndCopyFiles
	endif

	;; - - - - - - - - - - - - - - - - - - - - - -
	;; Que files destined for 'PEOPLE' directory,
	;; EXCEPT printer config files (printers.pdb,
	;; *.mnu, cfgprn.exe, ... )
	;; - - - - - - - - - - - - - - - - - - - - - -

	QuefileGroup 1 to [InstallationDirectory]

	;; - - - - - - - - - - - - - - - - - - - - - -
	;; Que SAMPLE files
	;; - - - - - - - - - - - - - - - - - - - - - -

	QuefileGroup 5 to [InstallationDirectory]\SAMPLE

	;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	;; If not already installed, que database files to instdir\PSFILES
	;; NOTE: The database files (16+ .DAT and 16+ .IDX files) comprise Grp 2
	;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	if [PreviouslyInstalled] = NoCharacter
		QueFileGroup 2 to [InstallationDirectory]\PSFILES
	endif


	;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	;; Transfer files (from que(s))
	;; Try "ShowJustOne" instead of "OnePerLine" (affects appearance only)
	;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



;; Thursday, 10/28/1993
;; Surround with "SetAllowExit On/ ... Off"
;; THIS PERMITS ESCaping out of file xfer (!)
;; Let's see if we can clean up properly...
;; Commented out 'cause Instalit doesn't handle Escaping from GetQuedFiles well.
;;
;; Remove Esc handler for duration of GetQuedFiles
;;
;;	LetButton <Esc> Do Nothing
;;	SetAllowExit On

	GetQuedFiles OnePerLine							;; NoInterruption

;; Thursday, 10/28/1993
;;
;; Restore SetAllowExit..., Esc handler
;;
;;	SetAllowExit Off
;;	LetButton <Esc> Do XferPgmEscape



	;; 12/10/93
	;; If previously installed, then we preserved existing PREF.DAT
	;; *provided* [SessionTempDir] is not blank;
	;; we now restore it to the installation directory (over the default
	;; PREF.DAT which we just installed in GetQuedFiles)

	if [PreviouslyInstalled] = YesCharacter
		if [SessionTempDir] = BlankString
		else

			CopyFiles from [SessionTempDir] to [InstallationDirectory] Quietly
				PREF.DAT
			EndCopyFiles

			DeleteFiles from [SessionTempDir] Quietly
				PREF.DAT
			EndDeleteFiles


			DeleteDirectory [SessionTempDir]

		endif
	endif


	;; END 12/10/93



	if QueSize <> 0						;; Fatal! (XferPgmEscape)
		Dialog PressAKey WhiteOnRed
			We were unable to extract or copy
			all of the program files.

			Installation cannot proceed.

		EndDialog

		Do XferPgmEscape
	endif



	;;------------------------------------------------
	;; Installed
	;;------------------------------------------------

	LetButton <Esc> Do nothing


	[Installed] := YesCharacter


	if [PreviouslyInstalled] = YesCharacter
		SetExitMessageTo "[ProductName] has been reinstalled."
	else
		SetExitMessageTo "[ProductName] has been installed."
	Endif


;;----------------------------------------------------------------------------
Procedure	XferPgmEscape

	[XferPgmErr] := YesCharacter
	Return		;; to exec'ing script

EndProcedure	;; XferPgmEscape

;;----------------------------------------------------------------------------
;;----------------------------------------------------------------------------
;;----------------------------------------------------------------------------

