;PAGESTREAM 3.0i TUNEUP #2 PATCH INSTALLATION SCRIPT
;COPYRIGHT ©1996 SOFT-LOGIK PUBLISHING CORPORATION

;QUIT PROGRAMS
(message "\n\nIf PageStream3, BME2 or PageLiner are running now, quit them before continuing.")
(run "avail flush" (safe))

;USE ASSIGNS TO AVOID THE STUPID INSTALLER'S CRASH BUG
(run "CD PageStream3:" (safe))
(run "CD SoftLogik:" (safe))
(run "assign fonts: softlogik:fonts add" (safe))

;GET DESTINATION
(set PGSdest (getassign "PageStream3" "a"))
(set SLdest (getassign "SoftLogik" "a"))
(if (OR (= PGSdest "") (= SLdest ""))
	(abort "PageStream3: and/or SoftLogik: are not assigned. You must properly install PageStream3.0i before applying this update patch.")
)
(set @default-dest PGSdest)

;CHECK IF BME EXISTS
(if (<> (exists "PageStream3:BME") 1)
	(abort "PageStream3 is not in the PageStream3: directory. You must properly install PageStream3.0i before applying this update patch.")
)

;UPDATE BME2
(if (exists "PageStream3:BME")
	(
		(working "Patching BME to 2.0f...")
		(run "spatch >NIL: <NIL: -oPageStream3:BME2.0f -pBME.pch PageStream3:BME")
		(if (exists "PageStream3:BME2.0f")
			(
				(delete "PageStream3:BME")
				(rename "PageStream3:BME2.0f" "PageStream3:BME")
			)
			(message "\nThe patch to BME was not successful. Refer to the Read.1st! file for further instructions.")
		)
		(delete "ram:BME.pch" (safe))
	)
)

;REMOVE THE LHEX PROGRAM
(delete "spatch" (safe))
(delete "Install-TuneUp2.info" (safe))

;DONE
(exit "BME 2.0f installed!")
