@echo off
if "%1"=="" goto usage

::bat&exe files
if NOT exist cinstall.bat  goto c1
for %%c in (a,b,d,hlpe,hlpr) do if NOT exist inst%%c.bat  goto c1
for %%c in (pkunzip,ask) do if NOT exist %%c.exe  goto c1
::list files
for %%c in (dvi1f,dvi1m,dvi2,emxrsx,first,mf,mfjob,tex,texcad) do if NOT exist %%c.lse goto c1
for %%c in (dvi1f,dvi1m,dvi2,emxrsx,first,mf,mfjob,tex,texcad) do if NOT exist %%c.lsg goto c1
for %%c in (ams,cm,emsy,ltx) do if NOT exist font%%c.lsf goto c1
for %%c in (ams,cm,emsy,ltx) do if NOT exist font%%c.lsm goto c1
for %%c in (babel,dvips,excludlh,lhfont32,fontec) do if NOT exist %%c.lsc goto c1
goto c2

:c1
cls
echo.
echo You have not all necessary files for cinst98 and eminst98 installation
echo in current directory. There are no:
echo.
::bat&exe files
if NOT exist cinstall.bat echo cinstall.bat
for %%c in (a,b,d,hlpe,hlpr) do if NOT exist inst%%c.bat echo inst%%c.bat
for %%c in (pkunzip,ask) do if NOT exist %%c.exe echo %%c.exe
::list files
for %%c in (dvi1f,dvi1m,dvi2,emxrsx,first,mf,mfjob,tex,texcad) do if NOT exist %%c.lse echo %%c.lse
for %%c in (dvi1f,dvi1m,dvi2,emxrsx,first,mf,mfjob,tex,texcad) do if NOT exist %%c.lsg echo %%c.lsg
for %%c in (ams,cm,emsy,ltx) do if NOT exist font%%c.lsf echo font%%c.lsf
for %%c in (ams,cm,emsy,ltx) do if NOT exist font%%c.lsm echo font%%c.lsm
for %%c in (babel,dvips,excludlh,lhfont32,fontec) do if NOT exist %%c.lsc echo %%c.lsc
pause
echo ERROR
set PC=error
goto end

:c2
cls
if exist %emtexdir%\INSTALL\LH\*.* goto c20
if NOT exist %emtexdir%\*.* md %emtexdir%
if NOT exist %emtexdir%\INSTALL\*.* md %emtexdir%\INSTALL
md %emtexdir%\INSTALL\LH
:c20
echo.
echo Copying installation batch-files
echo.
::bat&exe files
if NOT exist %eminst%\cinstall.bat copy cinstall.bat %eminst%
for %%c in (a,b,d,hlpe,hlpr) do if NOT exist %eminst%\inst%%c.bat copy inst%%c.bat %eminst%
for %%c in (pkunzip,ask) do if NOT exist %eminst%\%%c.exe copy %%c.exe  %eminst%
::list files
for %%c in (dvi1f,dvi1m,mf,mfjob,tex) do if NOT exist %eminst%\%%c.lse copy %%c.lse %eminst%
for %%c in (dvi1f,dvi1m,mf,mfjob,tex) do if NOT exist %eminst%\%%c.lsg copy %%c.lsg %eminst%
for %%c in (dvi2,first,emxrsx,texcad) do if NOT exist %eminst%\%%c.lse copy %%c.lse %eminst%
for %%c in (dvi2,first,emxrsx,texcad) do if NOT exist %eminst%\%%c.lsg copy %%c.lsg %eminst%
for %%c in (ams,cm,emsy,ltx) do if NOT exist %eminst%\font%%c.lsf copy font%%c.lsf %eminst%
for %%c in (ams,cm,emsy,ltx) do if NOT exist %eminst%\font%%c.lsm copy font%%c.lsm %eminst%
for %%c in (babel,dvips,excludlh,lhfont32,fontec) do if NOT exist %eminst%\%%c.lsc copy %%c.lsc %eminst%
goto c24
:c23
if NOT exist %eminst%\fontec.lsc   copy fontec.lsc %eminst%
:c24
if exist dvips.lsc    goto c25
goto end
:c25
if NOT exist %eminst%\dvips.lsc    copy dvips.lsc   %eminst%

goto end

:usage
echo This file is satellite to install98.bat and cinst98.bat
:end

