@echo off
cls
REM **********************************************************************
REM
REM SETUP.BAT - This batch file will start the CAS update process for NYL.
REM
REM     The following files must be in the update diskette.
REM
REM     1- UPDATE.PIF  -Default Windows environment settings.
REM     2- UPDATE.EXE  -NYL's update program.
REM     3- FPDMEM.EXE  -FDP's utility program, for memory configuration.
REM     4- FDPMEM.PIF  -Default Windows environment settings.
REM     5- SETUP.PIF   -Default Windows environment settings.
REM     6- PMINFO.EXE  -Memory testing utility, for DOS16M memory.
REM     7- PMINFO.PIF  -Default Windows environment settings.
REM     8- XMEMCHK.EXE -FDP's utility for DOS16M memory check.
REM                    -It has a small foot print and returns:
REM                        errorlevel(99) - Not enough DOS16M XMS.
REM                        errorlevel(1)  - Error occurred executing program.
REM                        errollevel(0)  - Successful and enough DOS16M XMS.
REM
REM     .... NOTE: .... Type XMEMCHK /?   - for parameter list.
REM **********************************************************************

@echo Please wait...Copying files
C:
CD\
if not exist CAS40UPD\nul mkdir CAS40UPD
CD CAS40UPD
copy A:\setup.bat
copy A:\setup.pif
copy A:\fdpmem.exe
copy A:\fdpmem.pif
copy A:\pminfo.exe
copy A:\pminfo.pif
copy A:\update.exe
copy A:\update.inf
copy A:\update.pif
copy A:\xmemchk.exe
copy A:\chkext.yes

if not exist c:\cas40upd\chkext.no goto :MEMCHK
del c:\cas40upd\chkext.no

:MEMCHK
XMEMCHK /NOSTOP
if errorlevel  99  goto :NOMEM
if errorlevel   1  goto :ERROR
goto :YESMEM

:ERROR
   ECHO.    ERROR RUNNING SETUP
   goto :EXIT

:YESMEM
  set CHKEXT=YES
  goto :CONTINUE

:NOMEM
  if not exist c:\cas40upd\chkext.yes goto :SETIT
  ren chkext.yes chkext.no
:SETIT  
  set CHKEXT=NO
  goto :CONTINUE

:CONTINUE
  CLS
@echo please wait... 
  UPDATE
  goto :EXIT

:EXIT
  C:
  CD\
  if exist c:\cas40upd\*.* goto :END
  rd cas40upd
:END
REM  SET
REM  PAUSE

