*********** DBNET.BAT -   VERSION 5.2
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
   IF EXIST AG_EXT.EXE FDP_MODE AG_EXT.EXE  /RW

:skip1
if exist fdp_exs1 goto exs1
if exist fdp_exn1 goto exn1
if exist fdp_ags1 goto ags1
if exist fdp_agn1 goto agn1
goto skip2

:exs1
copy /b fdp_exs1+fdp_Exs2 fdp_exos.exe
goto skip2

:exn1
copy /b fdp_exn1+fdp_Exn2 fdp_exon.exe
goto skip2

:skip2
if exist fdp_ags1 goto ags1
if exist fdp_agn1 goto agn1
goto skip2a

:ags1
copy /b fdp_ags1+fdp_ags2 fdp_ags1.exe
goto skip2a

:agn1
copy /b fdp_agn1+fdp_agn2 fdp_agn1.exe
goto skip2a

:skip2a
IF EXIST FDP_NSYS.EXE GOTO FDP_NSYS
 GOTO PAK2

:FDP_NSYS
 FDP_NSYS -O
 ERASE FDP_NSYS.EXE

:PAK2
 IF EXIST FDP_USYS.EXE GOTO FDP_USYS
 GOTO PAK2a

:FDP_USYS
 FDP_USYS -O
 ERASE FDP_USYS.EXE

:PAK2a
 IF EXIST FDP_HELP.EXE GOTO FDP_HELP
 GOTO PAK3

:FDP_HELP
 FDP_HELP -O
 ERASE FDP_HELP.EXE

:PAK3
 IF EXIST FDP_DATA.EXE GOTO FDP_DATA
 GOTO PAK4

:FDP_DATA
 FDP_DATA -O
 ERASE FDP_DATA.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 exo.stl goto PAK16
 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 PAK17b

:FDP_DOW2
 FDP_DOW2 -O
 ERASE FDP_DOW2.EXE

:PAK17b
IF EXIST FDP_DOWX.EXE GOTO FDP_DOWX
 GOTO PAK18

:FDP_DOWX
 FDP_DOWX -O
 ERASE FDP_DOWX.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 PAK21a

:FDP_LAP
 FDP_LAP -O
 ERASE FDP_LAP.EXE

:PAK21a
 IF EXIST FDP_FNA.EXE GOTO FDP_FNA
 GOTO PAK22

:FDP_FNA
 FDP_FNA -O
 ERASE FDP_FNA.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 PAK25

:FDP_REL
 FDP_REL -O
 ERASE FDP_REL.EXE

:PAK25
 IF EXIST FDP_EXOS.EXE GOTO FDP_EXOS
 GOTO PAK26

:FDP_EXOS
 FDP_EXOS -O
 ERASE FDP_EXOS.EXE

:PAK26
 IF EXIST FDP_EXON.EXE GOTO FDP_EXON
 GOTO ILLUS

:FDP_EXON
 FDP_EXON -O
 ERASE FDP_EXON.EXE


:ILLUS
 copy OUT.BAT illus

 if exist illus\*.* goto carryon

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

 del illus.

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

 echo.
 echo CREATING subdirectory called "ILLUS" under your existing FDP DATABASE
 echo directory.  All imported sales illustrations will be stored in this
 echo subdirectory.
 echo.
 echo.
 md illus

:CARRYON
IF EXIST illus\OUT.BAT del illus\OUT.BAT

REM - ***************************************************************
REM - if the file illus was created, delete it.
REM - ***************************************************************


:DOCS
 copy OUT.BAT docs

 if exist docs\*.* goto carryon2

 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

:CARRYON2
IF EXIST docs\OUT.BAT del docs\OUT.BAT

REM - ***************************************************************
REM - if the file docs was created, delete it.
REM - ***************************************************************
 
IF EXIST FDP_MODE.EXE GOTO FDP_MODE
GOTO END

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

:END
if exist agency1.ovl erase agency1.ovl
if exist agency2.ovl erase agency2.ovl
if exist dbinstal.exe erase dbinstal.exe
if exist check.dbf erase check.dbf
if exist install.bat erase install.bat
if exist install3.bat erase install3.bat
if exist install4.bat erase install4.bat
if exist install.exe erase install.exe
if exist install.dat erase install.dat
if exist fdp_Exs1 erase fdp_exs1
if exist fdp_Exs2 erase fdp_exs2
if exist fdp_Exn1 erase fdp_exn1
if exist fdp_Exn2 erase fdp_exn2
if exist DISK.ID erase DISK.ID
if exist reg.ins erase reg.ins
if exist exo.ins erase exo.ins

FDPMEM /NOSHOW
echo
