ECHO OFF
CLS

if exist stopit.stl goto conv2


IF EXIST FDP_MODE.EXE GOTO FDP_MOD1
GOTO CONV

:FDP_MOD1
if exist agency.ovl fdp_mode agency.ovl /rw
if exist agency.ovl erase agency.ovl
if exist options.exe FDP_MODE options.exe /rw
if exist options.exe erase options.exe
if exist options.ovl FDP_MODE options.ovl /rw
if exist options.ovl erase options.ovl


:CONV
echo off
cls
ECHO     ************************************************************
ECHO        Unpacking System files
ECHO     ************************************************************


if not exist FDP_MODE.EXE goto skip1
   IF EXIST AGENCY.EXE FDP_MODE AGENCY.EXE  /RW
   IF EXIST AGENCY1.OVL FDP_MODE AGENCY1.OVL  /RW
   IF EXIST AGENCY2.OVL FDP_MODE AGENCY2.OVL  /RW

:skip1

IF EXIST FDP_DATA.EXE GOTO FDP_DATA
GOTO PAK2

:FDP_DATA
 FDP_DATA -O
 ERASE FDP_DATA.EXE

:PAK2
 IF EXIST FDP_NSYS.EXE GOTO FDP_NSYS
 GOTO PAK3

:FDP_NSYS
 FDP_NSYS -O
 ERASE FDP_NSYS.EXE

:PAK3
 IF EXIST FDP_USYS.EXE GOTO FDP_USYS
 GOTO PAK4

:FDP_USYS
 FDP_USYS -O
 ERASE FDP_USYS.EXE

:PAK4
 IF EXIST FDP_REPT.EXE GOTO FDP_REPT
 GOTO PAK5

:FDP_REPT
 FDP_REPT -O
 ERASE FDP_REPT.EXE

:PAK5
 IF EXIST FDP_MAIN.EXE GOTO FDP_MAIN
 GOTO PAK10

:FDP_MAIN
 FDP_MAIN -O
 ERASE FDP_MAIN.EXE

:PAK10
 IF EXIST FDP_OPT.EXE GOTO FDP_OPT
 GOTO PAK11

:FDP_OPT
 FDP_OPT -O
 ERASE FDP_OPT.EXE

:PAK11
 IF EXIST FDP_COMM.EXE GOTO FDP_COMM
 GOTO PAK12

:FDP_COMM
 FDP_COMM -O
 ERASE FDP_COMM.EXE

:PAK12
 IF EXIST FDP_AGS1.EXE GOTO FDP_AGS1
 GOTO PAK13

:FDP_AGS1
 FDP_AGS1 -O
 ERASE FDP_AGS1.EXE

:PAK13
 IF EXIST FDP_AGS2.EXE GOTO FDP_AGS2
 GOTO PAK13b

:FDP_AGS2
 FDP_AGS2 -O
 ERASE FDP_AGS2.EXE

:PAK13b
 IF EXIST FDP_AGS3.EXE GOTO FDP_AGS3
 GOTO PAK14

:FDP_AGS3
 FDP_AGS3 -O
 ERASE FDP_AGS3.EXE

:PAK14
 IF EXIST FDP_AGN1.EXE GOTO FDP_AGN1
 GOTO PAK15

:FDP_AGN1
 FDP_AGN1 -O
 ERASE FDP_AGN1.EXE

:PAK15
 IF EXIST FDP_AGN2.EXE GOTO FDP_AGN2
 GOTO PAK15b

:FDP_AGN2
 FDP_AGN2 -O
 ERASE FDP_AGN2.EXE

:PAK15b
 IF EXIST FDP_AGN3.EXE GOTO FDP_AGN3
 GOTO PAK16

:FDP_AGN3
 FDP_AGN3 -O
 ERASE FDP_AGN3.EXE


:PAK16
 IF EXIST FDP_CAL.EXE GOTO FDP_CAL
 GOTO PAK17

:FDP_CAL
 FDP_CAL -O
 ERASE FDP_CAL.EXE

:PAK17
 IF EXIST FDP_DOWN.EXE GOTO FDP_DOWN
 GOTO PAK17a

:FDP_DOWN
 FDP_DOWN -O
 ERASE FDP_DOWN.EXE

:PAK17a
IF EXIST FDP_DOW2.EXE GOTO FDP_DOW2
 GOTO PAK18

:FDP_DOW2
 FDP_DOW2 -O
 ERASE FDP_DOW2.EXE

:PAK18
 IF EXIST FDP_TRAN.EXE GOTO FDP_TRAN
 GOTO PAK19

:FDP_TRAN
 FDP_TRAN -O
 ERASE FDP_TRAN.EXE

:PAK19
 IF EXIST FDP_MAIL.EXE GOTO FDP_MAIL
 GOTO PAK19a

:FDP_MAIL
 FDP_MAIL -O
 ERASE FDP_MAIL.EXE

:PAK19a
 IF EXIST FDP_CONC.EXE GOTO FDP_CONC
 GOTO PAK20

:FDP_CONC
 FDP_CONC -O
 ERASE FDP_CONC.EXE

:PAK20
 IF EXIST FDP_RR1.EXE GOTO FDP_RR1
 GOTO PAK20a

:FDP_RR1
 FDP_RR1 -O
 ERASE FDP_RR1.EXE

:PAK20a
 IF EXIST FDP_RR2.EXE GOTO FDP_RR2
 GOTO PAK20b

:FDP_RR2
 FDP_RR2 -O
 ERASE FDP_RR2.EXE

:PAK20b
 IF EXIST FDP_RRDB.EXE GOTO FDP_RRDB
 GOTO PAK21

:FDP_RRDB
 FDP_RRDB -O
 ERASE FDP_RRDB.EXE


:PAK21
 IF EXIST FDP_LAP.EXE GOTO FDP_LAP
 GOTO PAK22

:FDP_LAP
 FDP_LAP -O
 ERASE FDP_LAP.EXE

:PAK22
 IF EXIST FDP_EDIT.EXE GOTO FDP_EDIT
 GOTO PAK23

:FDP_EDIT
 FDP_EDIT -O
 ERASE FDP_EDIT.EXE

:PAK23
 IF EXIST FDP_REPM.EXE GOTO FDP_REPM
 GOTO PAK24

:FDP_REPM
 FDP_REPM -O
 ERASE FDP_REPM.EXE

:PAK24
 IF EXIST FDP_REL.EXE GOTO FDP_REL
 GOTO LASTONE

:FDP_REL
 FDP_REL -O
 ERASE FDP_REL.EXE

:LASTONE
 IF EXIST FDP_MODE.EXE GOTO FDP_MOD2
 GOTO DOCS

:FDP_MOD2
 IF EXIST AGENCY.EXE FDP_MODE AGENCY.EXE /RO


:DOCS
 copy OUT.BAT docs

 if exist docs\*.* goto carryon

 REM - ***************************************************************
 REM - if directory docs exists, then disk1. will be copied into that
 REM - directory.
 REM - ***************************************************************

 del docs.

 REM - *********************************************************************
 REM - must delete the file DOCS. before the directory DOCS can be created.
 REM - *********************************************************************

 echo.
 echo CREATING subdirectory called "DOCS" under your existing FDP DATABASE
 echo directory.  All documents will be stored in this subdirectory.
 echo.
 echo.
 md docs

:CARRYON

FDP_CONX -O
FDP_CON2 -O
ERASE FDP_CONX.EXE
ERASE FDP_CON2.EXE
NYLINST NYLINST.INF

:conv2
if exist stopit.stl erase stopit.stl
convx  //vmsize:16384 //f:51 //maxmem:2048
if exist stopit.stl goto stopit
if exist logo.com erase logo.com
REM erase convx.exe
if exist disk.id erase disk.id
if exist install.exe erase install.exe
if exist install.dat erase install.dat

FDPMEM /NOSHOW
IF EXIST DICT.CDX ERASE *.CDX
FDP /R/CONV
:stopit
