@echo off

:::     Virus Script Suite Installer
:::     Version 2.04        Tue  03/21/95
:::     Mark Hazen   (mhazen@fcs.uga.edu)

:main
 if not exist makefile.1 goto missing
 if not exist makefile.2 goto missing
 if not exist makefile.3 goto missing
 if not exist makefile.4 goto missing
 if not exist makefile.5 goto missing
 on break goto exit
 goto herewego

:missing
 color whi on bla
 cls
 echo I was unable to find all of the files I need to use to create the Virus
 echo Scanning Suite scripts. Please run the Installer from the directory
 echo you unpacked the files to.
 echo.
 delay 6
 goto exit

:herewego
 setdos /s0:0
 color bri whi on blu bord bla
 cls
 echo.
 echo.
 echo        ώ VIRUS SCRIPT SUITE INSTALLER ώ
 color bri yel on blu
 text

       This program custom builds the Virus Script Suite for version 2.04
       of the scripts.  If you have not done so already, read ALL of the
       documentation enclosed in the original archive.

       Disclaimer time-

       This package is provided, free of charge, in an "as-is" state;
       that is, neither the programmer nor the supplier will be held
       liable to any claims of performance or stability, and support for
       this product is solely at the discretion of the abovementioned
       parties. The abovementioned parties shall not be liable for any
       damages or problems which arise through the incorrect OR correct
       use of this product, not limited to software and/or hardware
       liabilities.

       This product may NOT be sold for profit by any organization or
       individual.
                                                [continued next page]
 endtext
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 6 blu on cya Press the 'any' key for the next page....
:readkey
 inkey /c /p %%instring
 set instring=

 color bri whi on blu bord bla
 cls
 echo.
 echo.
 echo        ώ VIRUS SCRIPT SUITE INSTALLER ώ
 color bri yel on blu
 text

       This product has been tested to the best of the author's capability,
       and is provided in good faith. If you are uncertain of the
       integrity of this archive PLEASE do yourself and the author a biiiig
       favor, and retrieve the -newest- version of this software via
       anonymous FTP from ftp.fcs.uga.edu (128.192.32.50), in the
       public/ftp/novell directory. The newest version of this software
       will be stored there as VSTExxx.ZIP, where xxx is a version number.

       Do understand and agree to the disclaimer as provided above?

 endtext
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 2 blu on cya Choose one of the above choices, using cursor keys and ENTER:
 echo Yeah! Let's kick viral butt! rNo! I thought I was installing WordPerfect!rLet me read that first page again, please!|set chosen=%@select[CON,14,18,18,63,]
 if %@instr[0,1,%chosen]==L goto main
 if %@instr[0,1,%chosen]==Y goto contin
 goto exit

:contin
 set chosen=

:getname
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
text

   Here we go! First of all, I need some basic information from you.
   The first one is an easy one: What would you like the title of your
   scanner to appear as to the user?

   This can be any text string, 58 characters or less in length. It will
   automatically be centered onscreen in your scanner's main menu page.

 endtext
 color bri whi on blu
 setdos /s10:100
 input /c /l58 `   Scanner Title:` %%title
 setdos /s0:0
 if %@len[%title] GT 2 goto gotname
 color bri yel on blu
 echo.
 echo    Please enter an actual title here. Something like "FRED'S SCANNER"
 echo    would be appropriate.
 beep 1800 2
 delay 3
 goto getname

:gotname
 color whi on blu
 echo.
 echo.
 echo      Your scanner is going to have a title which looks something like this:
 echo.
 echo           ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
 echo           Ί                                                           Ί
 echo           Ί                                                           Ί
 scrput 14 %@eval[39-(%@len[%title]/2)] bri whi on blu  %title 
 echo.
 echo    Is this title correct? (Y/n)
 inkey /c /p /k"yn" %%query
 if %query NE y goto getname

:getfpd
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
text

   Easy enough! Now I need to know the name of a directory on each of
   your user's hard drives I can store F-PROT in, to reduce the load on
   your server and speed their scanning up.

   If this directory does not exist on the user's hard drive, I will
   create it for them the first time they run the scanner.

 endtext
 color bri whi on blu
 setdos /s10:100
 input /c `   Local directory:` %%localdir
 setdos /s0:0
 if %@len[%localdir] GT 2 goto gotfpd
 color bri yel on blu
 echo.
 echo    Please enter a valid path for this string. Most folks like to use
 echo    something like "C:\FPROT" or "C:\UTIL", but use your judgement.
 beep 1800 2
 delay 3
 goto getfpd

:gotfpd
 set tmpstr=%@upper[%localdir]
 set localdir=%tmpstr
 set tmpstr=%@instr[%@eval[%@len[%localdir]-1],1,%localdir]
 if %tmpstr NE \ goto nofpds
 set tmpstr=%@instr[0,%@eval[%@len[%localdir]-1],%localdir]
 set localdir=%tmpstr
 goto gotfpd

:nofpds
 scrput 8 20 whi on blu `                                                              `
 scrput 8 20 bri whi on blu %localdir
 echo.
 color bri yel on blu
 echo    Is this path correct? (Y/n)
 inkey /c /p /k"yn" %%query
 if %query NE y goto getfpd

:getarcd
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
text

   Now, I need to know the path of a directory on your server where you
   will store an archive version of F-Prot. This is where you will put
   new versions of F-Prot as they become available.

   Please read the documentation for more information regarding updating
   the version of F-Prot you are using. This needs to be in a public area.

 endtext
 color bri whi on blu
 setdos /s10:100
 input /c `   Archive directory:` %%arcdir
 setdos /s0:0
 if %@len[%arcdir] GT 2 goto gotarcd
 color bri yel on blu
 echo.
 echo    Please enter a valid path for this string. Be specific, and include
 echo    the drive letter... don't assume I'll put it on your main net drive.
 beep 1800 2
 delay 3
 goto getarcd

:gotarcd
 set tmpstr=%@upper[%arcdir]
 set arcdir=%tmpstr
 set tmpstr=%@instr[%@eval[%@len[%arcdir]-1],1,%arcdir]
 if %tmpstr NE \ goto noarcs
 set tmpstr=%@instr[0,%@eval[%@len[%arcdir]-1],%arcdir]
 set arcdir=%tmpstr
 goto gotarcd

:noarcs
 scrput 8 22 whi on blu `                                                              `
 scrput 8 22 bri whi on blu %arcdir
 echo.
 color bri yel on blu
 if direxist %arcdir goto exarcd
 echo    This directory does not exist. Do you want to create it (Y/n)?
 inkey /c /p /k"yn" %%query
 if %query NE y goto getarcd
 md %arcdir>&NUL
 if %_?==0 goto exarcd
 echo    There was a problem creating this directory. Please make certain
 echo    that you have appropriate rights to create this directory, and
 echo    that you have entered a valid path, and try again.
 beep 1800 2
 delay 5
 goto getarcd

:exarcd
 echo    Is this path correct? (Y/n)
 inkey /c /p /k"yn" %%query
 if %query NE y goto getarcd

:getvssd
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
text

   Where would you like to store these scripts? This needs to be in a
   public area, once again. This directory will store the DOS and 4DOS
   scripts used in the Virus Script Suite.

   Please read the documentation for more information regarding what
   this directory is used for.

 endtext
 color bri whi on blu
 setdos /s10:100
 input /c `   Script directory:` %%vssdir
 setdos /s0:0
 if %@len[%vssdir] GT 2 goto gotvssd
 color bri yel on blu
 echo.
 echo    Please enter a valid path for this string. Be specific, and include
 echo    the drive letter... don't assume I'll put it on your main net drive.
 beep 1800 2
 delay 3
 goto getvssd

:gotvssd
 set tmpstr=%@upper[%vssdir]
 set vssdir=%tmpstr
 set tmpstr=%@instr[%@eval[%@len[%vssdir]-1],1,%vssdir]
 if %tmpstr NE \ goto novsss
 set tmpstr=%@instr[0,%@eval[%@len[%vssdir]-1],%vssdir]
 set vssdir=%tmpstr
 goto gotvssd

:novsss
 scrput 8 21 whi on blu `                                                              `
 scrput 8 21 bri whi on blu %vssdir
 echo.
 color bri yel on blu
 if direxist %vssdir goto exvssd
 echo    This directory does not exist. Do you want to create it (Y/n)?
 inkey /c /p /k"yn" %%query
 if %query NE y goto getvssd
 md %vssdir>&NUL
 if %_?==0 goto exvssd
 echo    There was a problem creating this directory. Please make certain
 echo    that you have appropriate rights to create this directory, and
 echo    that you have entered a valid path, and try again.
 beep 1800 2
 delay 5
 goto getvssd

:exvssd
 echo    Is this path correct? (Y/n)
 inkey /c /p /k"yn" %%query
 if %query NE y goto getvssd

:gettempd
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
text

   Now I need the path of a work directory, where the Virus Scanning
   Scripts can make temporary report files. These files will be deleted
   automatically when clean scans occur, but will be left if viruses
   are found. This way, you can always go check manually what a virus
   scan turned up. This directory should be on the local user's hard
   drive.

   If this directory does not exist on the user's hard drive, I will
   create it the first time they run the scanner.

 endtext
 color bri whi on blu
 setdos /s10:100
 input /c `   Temp directory:` %%tempdir
 setdos /s0:0
 if %@len[%tempdir] GT 2 goto gottempd
 color bri yel on blu
 echo.
 echo    Please enter a valid path for this string. Something like C: or
 echo    C:\TEMP is usually appropriate for this directory name.
 beep 1800 2
 delay 3
 goto gettempd

:gottempd
 set tmpstr=%@upper[%tempdir]
 set tempdir=%tmpstr
 set tmpstr=%@instr[%@eval[%@len[%tempdir]-1],1,%tempdir]
 if %tmpstr NE \ goto notemps
 set tmpstr=%@instr[0,%@eval[%@len[%tempdir]-1],%tempdir]
 set tempdir=%tmpstr
 goto gottempd

:notemps
 scrput 11 19 whi on blu `                                                              `
 scrput 11 19 bri whi on blu %tempdir
 echo.
 color bri yel on blu

:extempd
 echo    Is this path correct? (Y/n)
 inkey /c /p /k"yn" %%query
 if %query NE y goto gettempd

:getrepd
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
text

   I need a directory in which to store virus scan summary files, which
   can be used by you to check on exactly what the scanning information
   has produced, and also to allow for notification to you when a virus
   has been found. This must be a network drive, and it must be publicly
   writable. For more in depth information as to what this directory is
   for, consult the documentation.

 endtext
 color bri whi on blu
 setdos /s10:100
 input /c `   Summary directory:` %%repdir
 setdos /s0:0
 if %@len[%repdir] GT 2 goto gotrepd
 color bri yel on blu
 echo.
 echo    Please enter a valid path for this string. Be specific, and include
 echo    the drive letter... don't assume I'll put it on your main net drive.
 beep 1800 2
 delay 3
 goto getrepd

:gotrepd
 set tmpstr=%@upper[%repdir]
 set repdir=%tmpstr
 set tmpstr=%@instr[%@eval[%@len[%repdir]-1],1,%repdir]
 if %tmpstr NE \ goto noreps
 set tmpstr=%@instr[0,%@eval[%@len[%repdir]-1],%repdir]
 set repdir=%tmpstr
 goto gotrepd

:noreps
 scrput 8 22 whi on blu `                                                              `
 scrput 8 22 bri whi on blu %repdir
 echo.
 color bri yel on blu
 if direxist %repdir goto exrepd
 echo    This directory does not exist. Do you want to create it (Y/n)?
 inkey /c /p /k"yn" %%query
 if %query NE y goto getrepd
 md %repdir>&NUL
 if %_?==0 goto exrepd
 echo    There was a problem creating this directory. Please make certain
 echo    that you have appropriate rights to create this directory, and
 echo    that you have entered a valid path, and try again.
 beep 1800 2
 delay 5
 goto getrepd

:exrepd
 echo    Is this path correct? (Y/n)
 inkey /c /p /k"yn" %%query
 if %query NE y goto getrepd

:verify
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
text

   Just to recap, here's the information you gave me:

 endtext
 color bri yel on blu
 echos  My scanner's title:
 color bri whi on blu
 echo  %title
 color bri yel on blu
 echos  I'll find F-Prot on the user's drive in:
 color bri whi on blu
 echo  %localdir
 color bri yel on blu
 echos  I will find new versions of F-Prot in:
 color bri whi on blu
 echo  %arcdir
 color bri yel on blu
 echos  I should build the scripts in:
 color bri whi on blu
 echo  %vssdir
 color bri yel on blu
 echos  My workspace on user's hard drives should be:
 color bri whi on blu
 echo  %tempdir
 color bri yel on blu
 echos  I should file reports in:
 color bri whi on blu
 echo  %repdir
 echo.
 echo    Is ALL of the above correct? (Y/n)
 inkey /c /p /k"yn" %%query
 if %query NE y goto main

:build
 color whi on blu
 cls
 drawbox 24 0 24 79 0 cya on cya fill cya
 scrput 24 1 blu on cya Virus Script Suite Installer
 scrput 24 75 blu on cya v2.03
 echo.
 echo.
 echo    Please wait... building scripts using the information you gave me....
 echo.
 color bri yel on blu

 echo    Building VSCAN.BTM...

 type makefile.1>%vssdir\vscan.btm
 echos  set title=>>%vssdir\vscan.btm
 echo %title>>%vssdir\vscan.btm
 echo  set version=2.04>>%vssdir\vscan.btm
 echos  set fpdir=>>%vssdir\vscan.btm
 echo %localdir>>%vssdir\vscan.btm
 echos  set arcdir=>>%vssdir\vscan.btm
 echo %arcdir>>%vssdir\vscan.btm
 echos  set vssdir=>>%vssdir\vscan.btm
 echo %vssdir>>%vssdir\vscan.btm
 echos  set tempdir=>>%vssdir\vscan.btm
 echo %tempdir>>%vssdir\vscan.btm
 echos  set repdir=>>%vssdir\vscan.btm
 echo %repdir>>%vssdir\vscan.btm
 type makefile.2>>%vssdir\vscan.btm

 echo    Building VSSHELP.DAT...

 type makefile.5>>%vssdir\vsshelp.dat

 echo    Building VCHECK.BTM...

 type makefile.3>%vssdir\vcheck.btm
 echos  set repdir=>>%vssdir\vcheck.btm
 echo %repdir>>%vssdir\vcheck.btm
 type makefile.4>>%vssdir\vcheck.btm

 echo    Building VSCAN.BAT...

 echo @4dos /E:2048 /C %vssdir\vscan.btm>%vssdir\vscan.bat
 echo.
 color bri whi on blu
 text
   Installation has been completed. Please make certain you have installed
   F-Prot in the ARCHIVE directory location, and that your directories have
   the appropriate user rights for all of your users, as described in the
   accompanying documentation.

   To exit this Installer, please press any key.

 endtext
 inkey /c /p %%instring

:exit
 setdos /s10:100
 color whi on bla bord bla
 cls
 set instring=
 set tmpstr=
 set chosen=
 set title=
 set localdir=
 set arcdir=
 set vssdir=
 set tempdir=
 set repdir=

