@ECHO OFF

REM There are three parameters passed to this function
REM One: the Windows location
REM Two: the destination directory
REM Three: NOREBOOT command that if set does not reboot the computer

REM Check for the F-PROT DVP file
IF NOT EXIST DVPWIN.CSS GOTO UNZIP_FILES
   COPY %1\SYSTEM.INI %1\SYSTEM.FPT
   COPY %1\WIN.INI %1\WIN.FPT
   REM Make a TEMP directory
   MD _TEMP
   REM Copy the DVP file in
   COPY DVPWIN.CSS _TEMP > NUL
   COPY AUTOINST.INI _TEMP > NUL
   REM Go in with it
   CD _TEMP
   REM Uncompress the files for FP-DVP
   ..\COMPRESS DVPWIN.CSS -d -o
   REM Copy the following lines to the end of the INI file
   ECHO InstallFrom=%2\_TEMP>> AUTOINST.INI
   ECHO InstallTo=%2>> AUTOINST.INI
   ECHO. >> AUTOINST.INI
   ECHO [Local] >> AUTOINST.INI
   ECHO WindowsDirectory=%1>> AUTOINST.INI
   REM A person can edit the AUTOINST.INI file for extra control of FP-DVP
   AUTOINST
   REM This files is needed to counteract video drivers
   COPY F-PROTW.INI %1 > NUL
   DEL F-PROTW.INI
   CD..
   REM All done, remove the temp directories
   ECHO Y | DEL _TEMP > NUL
   RD _TEMP
   REM Del the WVIRSTOP support, both are not needed.
   IF EXIST WVIRSTOP.* DEL WVIRSTOP.*
   IF EXIST VIRSTOP.DLL DEL VIRSTOP.DLL
   IF EXIST %1\WVIRSTOP.* DEL %1\WVIRSTOP.*
   IF EXIST %1\VIRSTOP.DLL DEL %1\VIRSTOP.DLL

   CD LOCAL
   RD BULLETIN
   RD INFECT
   RD MESSAGES
   RD REPORTS
   RD REPUSER
   RD SUSPECT
   RD TASKS
   CD..
   RD LOCAL

:UNZIP_FILES
REM FPWIN support files
IF EXIST *.FPW GOTO UPGRADE
IF EXIST FPW.CSS      COMPRESS.EXE FPW.CSS     -D -O

:UPGRADE
REM FPWIN main executable
IF EXIST FPROTW.CSS   COMPRESS.EXE FPROTW.CSS  -D -O
IF EXIST SPROTW.CSS   COMPRESS.EXE SPROTW.CSS  -D -O
REM WIN stub for the DOS installation
IF EXIST WINSET.CSS   COMPRESS.EXE WINSET.CSS  -D -O
REM VIRSTOP support in Windows
IF EXIST WVIRSTOP.CSS COMPRESS.EXE WVIRSTOP.CSS -D -O
REM Banyan vines support
IF EXIST BANYAN.CSS   COMPRESS.EXE BANYAN.CSS  -D -O
REM Novell support
IF EXIST NOVCAST.CSS  COMPRESS.EXE NOVCAST.CSS -D -O
REM Data integrity data base
IF EXIST CHECK.CSS    COMPRESS.EXE CHECK.CSS   -D -O

IF EXIST SCAN.CSS     COMPRESS.EXE SCAN.CSS    -D -O

REM Copy WVIRSTOP to the WIN dir
IF EXIST WVIRSTOP.EXE COPY WVIRSTOP.EXE %1
REM Delete it from the destination dir
IF EXIST WVIRSTOP.EXE DEL WVIRSTOP.EXE
REM Place WVIRSTOP in the WIN.INI
IF EXIST %1\WVIRSTOP.EXE %1\WVIRSTOP /QUIET

REM COPY VIRSTOP.DLL TO THE WINDOWS DIRECTORY
REM THEN DELETE IT FROM THE F-PROT DIR.
IF EXIST VIRSTOP.DLL COPY VIRSTOP.DLL %1
IF EXIST VIRSTOP.DLL DEL VIRSTOP.DLL

REM DELETE THE .CSS FILES AND DEL COMPRESS.EXE
DEL *.CSS
DEL COMPRESS.EXE
REM DELETE INTERUM PROGRAM WHEN DONE
DEL COMEXIT.COM


REM EXECUTE WINSET IF IT EXISTS
REM AND DELETE IT WHEN DONE
IF EXIST WINSET.EXE WINSET.EXE %1
IF EXIST WINSET.EXE DEL WINSET.EXE

REM CLEAR THE SCREEN AND RUN FIXDISK INSTALLATION
CLS
IF EXIST FIXDISK.EXE FIXDISK RESCUE CREATE

REM CLEAR THE SCREEN AND SHOW ENDING INFORMATION
CLS
REM CHECK TO SEE IF REBOOTING IS DESIREABLE
IF '%3'=='NOREBOOT' GOTO END

ECHO.
ECHO      Changes have been made in the start-up files.
ECHO      In order for those changes to take effect,
ECHO      your computer must be rebooted. If there is a
ECHO      disk in drive A:, please remove it at this time.
ECHO.

ECHO      If your computer does not reboot,
ECHO      press CTRL+ALT+DEL or the RESET button.
ECHO.

ECHO Press any key to reboot...
PAUSE > NUL
REM Runs the REBOOT file located within the F-PROT directory
REM If the file does not exist loop continuously
REM and force the user to REBOOT.
:RESTART
IF EXIST REBOOT.COM REBOOT
GOTO RESTART

REM The ending for the NOREBOOT switch
:end
ECHO.
ECHO Type F-PROT to run F-PROT.
