home *** CD-ROM | disk | FTP | other *** search
- echo off
- rem
- rem Do not distribute ZOO2ZIPH.BAT separately from the rest of the package
- rem
-
- rem If you get an "Out of environment space" message, increase your
- rem environment space by using shell configuration in config.sys:
- rem Example: shell=c:\bin\command.com /e:1024 /p
-
- echo.
- echo ┌───────────────────────────────────────────────────────────────┐
- echo │ Convert and datestamp a single .zoo to .zip file with comment │
- echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Tue 4-Feb-1992 │
- echo └───────────────────────────────────────────────────────────────┘
- if not "%1"=="" goto _continue
- echo.
- echo Usage: ZOO2ZIPH PackageName [/r(eplace the old .zoo with the new .zip)]
- echo Use no drive name! No extension!
- echo ┌───────────────┐
- echo │ NO WILDCARDS! │
- echo └───────────────┘
- echo.
- echo When using for the first time:
- echo 1) Make zoo.exe, pkzip.exe, and scan.exe available (not provided)
- echo 2) Make a new directory e:\arczip\zip for converted files
- echo 3) Edit your own zip-file comment to e:\arczip\comment.txt (not provided)
- echo.
- echo Usually:
- echo Place the .zoo file in directory e:\arczip\arc
- echo And run normally
- echo.
- echo.
- echo.
- goto _out
-
- :_continue
- rem Do the necessary program and comment files exist
- if not exist c:\tools\pkzip.exe goto _err1
- if not exist c:\box\boxtools\zoo.exe goto _err2
- if not exist e:\arczip\comment.txt goto _err3
- if not exist e:\arczip\zip\nul goto _err8
- if not exist c:\tools\scan.exe goto _err11
-
- rem Check that no wildcards or extension was used
- for %%f in (%1) do if "%%f"=="%1" goto _ok
- echo.
- echo Wildcards / extensions not allowed in %1
- goto _out
-
- :_ok
- rem Build the names for source .zoo and target .zip files
- set _filea=e:\arczip\arc\%1.zoo
- set _filez=e:\arczip\zip\%1.zip
- if not exist %_filea% goto _err4
- if exist %_filez% goto _err5
- if not exist e:\arczip\tmp$$$\nul md e:\arczip\tmp$$$
- if exist e:\arczip\tmp$$$\*.* goto _err9
-
- rem Test .zoo archive integrity
- c:\box\boxtools\zoo -test %_filea%
- if errorlevel==1 goto _err10
-
- rem Unpack and check for viruses
- e:
- cd \arczip\tmp$$$
- c:\box\boxtools\zoo e %_filea%
- c:\tools\scan /m /nomem /x e:\arczip\tmp$$$
- if errorlevel==1 goto _err12
-
- rem Convert, use the date of the latest file, not the current date
- pkzip -a %_filez% e:\arczip\comment.txt
- pkzip -z %_filez% < e:\arczip\comment.txt
- pkzip -d %_filez% comment.txt
- pkzip -br:\ -u -m -o %_filez% e:\arczip\tmp$$$\*.*
- pkzip -v %_filez%
- dir %_filez%
- cd \arczip
- rd e:\arczip\tmp$$$
-
- rem State of the /r switch for replacing the old .zoo file
- if "%2"=="/r" goto _replace
- if "%2"=="/R" goto _replace
- goto _out
-
- rem Replace the old .zoo file with the new .zip file
- :_replace
- echo.
- echo To delete %_filea% press any key
- echo To cancel, use the Break key now
- pause >nul
- if not exist %_filez% goto _err6
- if exist %_filea% del %_filea%
- if exist %_filea% goto _err7
- echo.
- echo File %_filea% deleted
- goto _out
-
- :_err1
- Echo File c:\tools\pkzip.exe not found
- goto _out
-
- :_err2
- Echo File c:\box\boxtools\zoo.exe not found
- goto _out
-
- :_err3
- Echo File e:\arczip\comment.txt not found
- goto _out
-
- :_err4
- Echo File %_filea% not found
- echo.
- echo Usage: ZOO2ZIPH PackageName [/r(eplace the old .zoo with the new .zip)]
- echo Use no drive name! No extension!
- echo ┌───────────────┐
- echo │ NO WILDCARDS! │
- echo └───────────────┘
- goto _out
-
- :_err5
- Echo File %_filez% already exists
- goto _out
-
- :_err6
- Echo ZOO2ZIPH aborted: File %_filez% not found
- goto _out
-
- :_err7
- Echo ZOO2ZIPH aborted: Disk or file %_filea% is readonly
- goto _out
-
- :_err8
- Echo Error: Directory e:\arczip\zip does not exist
- goto _out
-
- :_err9
- Echo Error: Directory e:\arczip\tmp$$$ is not empty
- goto _out
-
- :_err10
- Echo ZOO2ZIPH aborted: Error in %_filea%
- goto _out
-
- :_err11
- Echo File c:\tools\scan.exe not found
- goto _out
-
- :_err12
- Echo ZOO2ZIPH aborted: Scan reports problems in c:\arczip\tmp$$$
- goto _out
-
- :_out
- set _filea=
- set _filez=
- echo on
-