;DATASTORE 1.1 ONLINE UPDATE PATCH INSTALLATION SCRIPT
;COPYRIGHT ©1995 DIGITA INTERNATIONAL AND SOFT-LOGIK PUBLISHING CORPORATION

(message "\n\nThis will update your hard drive installation of Datastore 1.0 revision 3 (1.0r3) to version 1.1. It requires that Datastore 1.0r3 be installed on your hard drive.\n\nYour original Datastore disk will not be modified by this update.")

;GET DATASTORE DIRECTORY
(set DSdest
	(askdir
		(prompt
			"Where is Datastore installed?\n "
			"Click on the Datastore drawer.\n")
                (help
			"\n\nYou must select the Datastore drawer so that "
			"this installer can update the installation.")
                (default @default-dest)
        )
)
(set temp1 (tackon DSdest "DSProg"))
(set temp2 (tackon DSdest "Datastore"))
(if (AND (<> (exists temp1) 1) (<> (exists temp2) 1))
	(abort "Datastore 1.0r3 is not located in this directory.")
)
(set @default-dest DSdest)
(makeassign "Datastore" DSdest (safe))

;UPDATE DATASTORE
(working "\n\nPatching Datastore 1.0r3 to 1.1...")
(run "spatch >NIL: <NIL: -oDatastore:DSProg1.1 -pDSProg.pch Datastore:DSProg")
(run "spatch >NIL: <NIL: -oDatastore:Datastore1.1 -pDatastore.pch Datastore:Datastore")
(if (AND (exists "Datastore:DSProg1.1") (exists "Datastore:Datastore1.1"))
	(
		(delete "Datastore:DSProg")
		(delete "Datastore:Datastore")
		(rename "Datastore:DSProg1.1" "Datastore:DSProg")
		(rename "Datastore:Datastore1.1" "Datastore:Datastore")
	)
	(abort "Patch was not successful. DSprog or Datastore file could not be patched due to incorrect version, lack of hard drive space, or RAM.")
)

;ALL DONE
(exit "Datastore updated to version 1.1!")
