@echo off
if not "%1" == "/*" goto aa
if "%2" == "..1.12" goto us1
cls
:usage
echo - For use with FWKCS(TM) Contents_Signature System, Version 1.12.
echo - (C)Copyright Frederick W. Kantor 1991. All rights reserved.
echo -
:us1
echo - 2_SETUP.BAT to install the FWKCS(TM) Contents_Signature System,
echo -             searching for non_directory files,
echo -             on a system with no overlapping paths, any drive(s) C:-Z:.
echo -             (Note: this does not install options g and z.
echo -              See SETUP.112 and FWKCS112.REF.)
echo -
echo - Usage:  2_SETUP d n D N  "<enter>"
echo -
echo - d  without a ":" is drive for the \CS Contents_Signature subdirectory.
echo -
echo - n = 1 include only zipfiles with extension .Z*.
echo -     2 include only zipfiles, any or no extension, self_extracting or not.
echo -     3 include all accessible non_directory files.
echo -
echo - D  without a ":" is drive for the \CSA Contents_Signature Activity place.
echo -
echo - N = 1 single user, no bulletin board system.
echo -     2 single local user, with (multi_node) bulletin board system.
echo -     3 multiple local users, with (multi_node) bulletin board system.
goto ng
:aa
if not exist fwkcs112.zip goto nd
if "%1" == "" goto help1
if "%2" == "1" goto ab
if "%2" == "2" goto ab
if "%2" == "3" goto ab
goto help2
:ab
if "%3" == "" goto help3
if "%4" == "1" goto bb
if "%4" == "2" goto bb
if "%4" == "3" goto bb
goto help4
:bb
md %1:\cs > nul
echo TEST > %1:\cs\!@#^#@!@.tmp
if not exist %1:\cs\!@#^#@!@.tmp goto nmd1
del %1:\cs\!@#^#@!@.tmp > nul
md %3:\csa > nul
echo TEST > %3:\csa\!@#^#@!@.tmp
if not exist %3:\csa\!@#^#@!@.tmp goto nmd2
del %3:\csa\!@#^#@!@.tmp > nul
rd %3:\csa > nul
if exist #@!#@!^^.@!@ attrib -r #@!#@!^^.@!@ > nul
if exist #@!#@!^^.@!@ del #@!#@!^^.@!@ > nul
if exist @@!#@!^^.@!@ attrib -r @@!#@!^^.@!@ > nul
if exist @@!#@!^^.@!@ del @@!#@!^^.@!@ > nul
echo sort test > #@!#@!^^.@!@
qsort #@!#@!^^.@!@ @@!#@!^^.@!@ > nul
del #@!#@!^^.@!@ > nul
if not exist @@!#@!^^.@!@ goto nsrt
cls
del @@!#@!^^.@!@ > nul
if exist !! attrib -r !! > nul
if exist !! del !! > nul
pkunzip -o fwkcs112 !! > nul
if not exist !! goto nz
pkunzip -o fwkcs112 %1:\cs @!! > nul
del !! > nul
%1:
cd %1:\cs
fwkcs %1:\cs\cslist.ndx /d1
fwkcs %1:\cs\cslist.srt /d2
fwkcs %1:\cs\cslist1.ndx /d3
fwkcs %1:\cs\cslist1.srt /d4
if "%2" == "2" goto cb
if "%2" == "3" goto cc
fwkdg /l | find ".Z" | fwkcs /1cfxz | qsort > cslist.srt
goto dd
:cb
fwkdg /l | fwkcs /1cfxz | qsort > cslist.srt
goto dd
:cc
fwkdg /l | fwkcs /1cfpxz | qsort > cslist.srt
:dd
fwkcs cslist.ndx cslist.srt /i
attrib +r cslist.ndx
attrib +r cslist.srt
cls
fwkcs cslist1.ndx cslist1.srt /u
goto end1
:nd
echo -
echo - Did not find FWKCS112.ZIP.
goto helpr
:nmd1
echo -
echo - Did not succeed in making %1:\CS.  Please check your system, and...
goto helpr
:nmd2
echo -
echo - Did not succeed in making %3:\CSA.  Please check your system, and...
goto helpr
:nsrt
echo -
echo - Where is Ben Baker's QSORT?
goto helpr
:nz
echo -
echo - Where is Phil Katz's PKUNZIP(R)?
goto helpr
:help1
echo -
echo - Where should I put the \cs subdirectory?
goto helpr
:help2
echo -
echo - I need a digit n (1 2 3) re files to include.
goto helpr
:help3
echo -
echo - Where should I put the Contents_Signature Activity \CSA place?
goto helpr
:help4
echo -
echo - I need a digit N (1 2 3) re system configuration.
:helpr
echo -
echo -           Please try again.
echo -
goto usage
:end1
echo -
echo - Installed FWKCS(TM) Contents_Signature System files
echo -  cslist.ndx, cslist.srt, cslist1.ndx, and cslist1.srt
echo -  in the \CS Contents_Signature subdirectory.
if "%2" == "3" goto zv
echo -  Only zip_format files were included.
:zv
echo -
echo - The on_line help menu for .BAT and .COM programs in the
echo - \CS Contents_Signature subdirectory is CSM.BAT.
echo -
echo -    To start it, type    CSM "<enter>"
echo -
echo - For on_line help from any .BAT or .COM program in the \CS subdirectory,
echo -
echo -    type    NAME /* "<enter>"  ,  where NAME is the program's name.
echo -
if exist #@!^!@#@.bat attrib -r #@!^!@#@.bat > nul
echo csamacs %3 %4 > #@!^!@#@.bat
#@!^!@#@
:ng
echo -
if not "%2" == "..1.12" goto zz
if exist QUERYFLA.GUP attrib -r QUERYFLA.GUP > nul
if exist QUERYFLA.GUP del QUERYFLA.GUP > nul
:zz
