@echo off
cls

if "%1"=="OK" goto start
goto error

:start
if exist inven.dbf goto backup1
unpack
del unpack.exe
goto end

:backup1
cls
echo.
echo.                                WARNING!
echo During the remainder of the install process, you  may see  messages  such as 
echo "duplicate file name" or "file not found". These messages NORMAL and  should 
echo be ignored.However,at a certain point in the Install process when the system 
echo is  being "unpacked", you may  see a message such as "File already exists... 
echo overwrite?".You must answer these prompts as they occur in order for Install 
echo to proceed. Normally, you will  answer "y" in  every  case  but examine  the 
echo filename to be certain you will not be overwriting  custom report (*.frm) or 
echo label forms (*.lbl). If you have not customized any reports or labels from a 
echo previous version, always answer "y" when you see these prompts.
echo.
pause
cls

if exist address.dbf goto backup2

del x*.*
rename barcodes.dbf xbarcode.dbf
rename composit.dbf xcomposi.dbf
rename copies.dbf xcopies.dbf
rename costing.dbf xcosting.dbf
rename history.dbf xhistory.dbf
rename idisc.dbf xidisc.dbf
rename inven.dbf xinven.dbf
rename po.dbf xpo.dbf
rename ponum.dbf xponum.dbf
rename poytd.dbf xpoytd.dbf
rename reports.dbf xreports.dbf
rename serial.dbf xserial.dbf
rename setup.dbf xsetup.dbf
rename vendors.dbf xvendors.dbf

rename inven.dbv xinven.dbv

del *.doc

del icp.exe
del setup.exe
del rl.exe
del dbu.exe

del *.cmx

cls
unpack
echo.
echo.
pause
goto end

:backup2
del x*.*
rename address.dbf xaddress.dbf
RENAME BARCODES.DBF XBARCODE.DBF
rename bkord.dbf xbkord.dbf
rename cdisc.dbf xcdisc.dbf
rename coa.dbf xcoa.dbf
rename coaytd.dbf xcoaytd.dbf
rename codes.dbf xcodes.dbf
RENAME COMMENT.DBF XCOMMENT.DBF
rename composit.dbf xcomposi.dbf
rename copies.dbf xcopies.dbf
rename costing.dbf xcosting.dbf
rename custhx.dbf xcusthx.dbf
rename dreg.dbf xdreg.dbf
rename history.dbf xhistory.dbf
rename idisc.dbf xidisc.dbf
rename inven.dbf xinven.dbf
rename invoice.dbf xinvoice.dbf
rename jreg.dbf xjreg.dbf
rename po.dbf xpo.dbf
rename ponum.DBF xponum.DBF
rename poytd.dbf xpoytd.dbf
rename reports.dbf xreports.dbf
rename scode.dbf xscode.dbf
rename setup.dbf xsetup.dbf
rename serial.dbf xserial.dbf
RENAME SREG.DBF XSREG.DBF
rename stmt.dbf xstmt.dbf
rename till.dbf xtill.dbf
rename vendors.dbf xvendors.dbf
rename yreg.dbf xyreg.dbf

rename address.dbv xaddress.dbv
rename inven.dbv xinven.dbv

del pics.exe
del rl.exe
del setup.exe
del dbu.exe

del *.cmx
del temp.*
del tinven.*

cls
unpack
echo.
echo.
pause
goto end

:end
transfer
del unpack.exe
del transfer.exe

@echo off
cls
echo.
echo.
echo.
echo You MUST run the SETUP program and establish  your system
echo parameters before running the ICP/PICS program. This is a 
echo critical step!
echo.
pause
del update.bat
del *.cmx

:error
cls
echo.
echo.
echo.
echo This file must be executed by the install program ONLY!


