@echo off rem Batch file to install emTeX and emtexgi rem Allin Cottrell, 28 February 1997 rem First parameter: 31 (for Windows 3.1) or 95 (for Windows 95/NT) rem Second parameter: Path to windows system directory. echo This is a batch file for installing emTeX plus the echo Windows interface emtexgi. Please consult the echo documentation before running this program. echo *** if %1. == . goto missparam if %2. == . goto nosysdir if %1 == 31 goto win31 rem Else it's win95 echo Win95 (or NT) -- Using 32-bit apps where applicable, echo with 32-bit DLLs going to %2 -- goto next1 :win31 echo Win 3.1 -- Using 16-bit apps where required, with echo DLLs going to %2 -- :next1 echo I trust this is OK? (ctrl-c to abort) echo *** pause if exist %2\nul goto winsysok echo *** echo Sorry, I can't find the directory you specified as your echo Windows system directory. Please try again. goto end :winsysok rem Check for the required basic files... if not exist unzip.exe goto errmsg1 if not exist first.zip goto errmsg1 if not exist fontcm.zip goto errmsg1 if not exist fontltx.zip goto errmsg1 if not exist l2input.zip goto errmsg1 if not exist mf4b.zip goto errmsg1 if not exist tex4b.zip goto errmsg1 if not exist dviwin29.zip goto errmsg1 if not exist rsx521b.zip goto errmsg1 if not exist rsxwin31.zip goto errmsg1 if not exist emtexgi.zip goto errmsg1 .\unzip first.zip -d \ .\unzip fontcm.zip -d \ .\unzip fontltx.zip -d \ .\unzip l2input.zip -d \ mkdir \rsx mkdir \rsx\bin .\unzip -j rsx521b.zip RSX/BIN/RSX.EXE -d \rsx\bin .\unzip -j rsx521b.zip RSX/BIN/RSXOPT.EXE -d \rsx\bin .\unzip mf4b.zip emtex/bin/mf386.exe -d \ .\unzip mf4b.zip emtex/bin/gftopk.exe -d \ .\unzip mf4b.zip emtex/bin/mak*.* -d \ .\unzip mf4b.zip emtex/bmfbases/mf.poo -d \ .\unzip mf4b.zip emtex/mfinput/*.* -d \ .\unzip mf4b.zip emtex/doc/*.* -d \ .\unzip mf4b.zip emtex/remove/*.* -d \ .\unzip mf4b.zip emtex/data/*.* -d \ .\unzip tex4b.zip emtex/bin/tex386.exe -d \ .\unzip tex4b.zip emtex/btexfmts/tex.poo -d \ .\unzip tex4b.zip emtex/texinput/*.* -d \ .\unzip tex4b.zip emtex/remove/*.* -d \ .\unzip tex4b.zip emtex/data/*.* -d \ .\unzip tex4b.zip emtex/doc/*.* -d \ .\unzip tex4b.zip emtex/bin/mak*.* -d \ rem Now for the "optional" emTeX files: for %%a in (bibtex4b.zip fontams.zip fontec.zip) do if exist %%a .\unzip %%a -d \ for %%a in (fontemsy.zip german.zip l2tools.zip) do if exist %%a .\unzip %%a -d \ for %%a in (mfware.zip texcad.zip) do if exist %%a .\unzip %%a -d \ for %%a in (texware.zip makeindx.zip) do if exist %%a .\unzip %%a -d \ for %%a in (babel.zip hyphen.zip amsfiles.zip) do if exist %%a .\unzip -o %%a -d \ if exist graphics.zip .\unzip graphics.zip -d \emtex\texinput if exist ispell.zip .\unzip ispell.zip -d \ rem Now dviwin: mkdir \dvidrvrs .\unzip dviwin29.zip -d \dvidrvrs mkdir \texfonts copy \dvidrvrs\dviwin.sub \texfonts if %1 == 31 goto dvi31 rem Code for dviwin under Win95... del \dvidrvrs\*.exe del \dvidrvrs\*.dll del \dvidrvrs\dviwin.hlp del \dvidrvrs\wbr.hlp .\unzip \dvidrvrs\dviwin32.zip -d \dvidrvrs copy \dvidrvrs\dviwin2.hlp \emtex\bin\dviwin.hlp if exist %2\ctl3d32.dll goto skip3d1 copy \dvidrvrs\ctl3d32.dll %2 :skip3d1 del \dvidrvrs\ctl3d32.dll goto end31 :dvi31 rem Code for dviwin under Win3.1 del \dvidrvrs\dviwin32.zip copy \dvidrvrs\dviwin.hlp \emtex\bin if exist %2\ctl3dv2.dll goto skip3d2 copy \dvidrvrs\ctl3dv2.dll %2 :skip3d2 del \dvidrvrs\ctl3dv2.dll :end31 rem Install rsxwin mkdir \rsx mkdir \rsx\bin .\unzip -j rsxwin31.zip RSXWIN/BIN/RSXWIN.EXE -d \rsx\bin .\unzip -j rsxwin31.zip RSXWIN/BIN/RSXIO.DLL -d \rsx\bin .\unzip -j rsxwin31.zip RSXWIN/DOC/RSXWIN.HLP -d \rsx\bin rem Install PFE if %1 == 95 goto pfe95 if not exist pfe101.zip goto nopfe mkdir \pfe .\unzip pfe101.zip -d \pfe goto pfedone :pfe95 if not exist pfe101i.zip goto nopfe mkdir \pfe .\unzip pfe101i.zip -d \pfe :pfedone goto pfeok :nopfe echo *** echo Programmer's File Editor (PFE) was not found. Perhaps echo you intend to use a different editor. If the absence echo of PFE was inadvertant, please acquire pfe101.zip (for echo Windows 3.1) or pfe101i.zip (Win95) and run emtex.bat echo again. (ctrl-c to abort) echo *** pause :pfeok rem Install dvips if not exist dvips583.zip goto nodvips .\unzip dvips583.zip .\unzip dvipsexe.zip -d \ goto dvipsok :nodvips echo *** echo Dvips583.zip was not found. Perhaps you do not echo intend to make postscript files. If the absence echo of dvips583.zip was inadvertant, please acquire echo this file and run emtex.bat again. echo (ctrl-c to abort) echo *** pause :dvipsok rem Install emtexgi mkdir \emtex\mytex .\unzip emtexgi.zip -d \emtex\mytex if not exist \emtex\texinput\graphics\graphics.ins goto nogrfx copy \emtex\mytex\emtgrfx.ins \emtex\texinput\graphics :nogrfx del \emtex\mytex\emtgrfx.ins rem emtexgi: deal with dlls rem if not exist %2\nul goto skipdlls if %1 == 31 goto dll31 rem dlls under Windows 95 or NT if not exist dll95.zip goto nodll95 .\unzip dll95.zip rem vb40032 if exist %2\vb40032.dll goto skipvb400 copy vb40032.dll %2 \emtex\mytex\regsvr32 /s %2\vb40032.dll :skipvb400 del vb40032.dll rem commdlg if exist %2\comdlg32.ocx goto skipocx copy comdlg32.ocx %2 \emtex\mytex\regsvr32 /s %2\comdlg32.ocx :skipocx del comdlg32.ocx rem ven if exist %2\ven2232.olb goto skipven copy ven2232.olb %2 \emtex\mytex\regsvr32 /s %2\ven2232.olb :skipven del ven2232.olb rem olepro32 if exist %2\olepro32.dll goto skipole copy olepro32.dll %2 \emtex\mytex\regsvr32 /s %2\olepro32.dll :skipole del olepro32.dll rem msvcrt20 if exist %2\msvcrt20.dll goto skip20 copy msvcrt20.dll %2 \emtex\mytex\regsvr32 /s %2\msvcrt20.dll :skip20 del msvcrt20.dll rem msvcrt40 if exist %2\msvcrt40.dll goto skip40 copy msvcrt40.dll %2 \emtex\mytex\regsvr32 /s %2\msvcrt40.dll :skip40 del msvcrt40.dll rem mfc40 if exist %2\mfc40.dll goto skipmfc copy mfc40.dll %2 \emtex\mytex\regsvr32 /s %2\mfc40.dll :skipmfc del mfc40.dll del \emtex\mytex\regsvr32.exe goto skipdlls :dll31 del \emtex\mytex\regsvr32.exe if not exist dll31.zip goto nodll31 .\unzip dll31.zip rem vbrun300 if exist %2\vbrun300.dll goto skipvb copy vbrun300.dll %2 :skipvb del vbrun300.dll rem commdlg if exist %2\commdlg.dll goto skipdlg copy commdlg.dll %2 :skipdlg del commdlg.dll rem vbx if exist %2\cmdialog.vbx goto skipvbx copy cmdialog.vbx %2 :skipvbx del cmdialog.vbx rem ctl3d if exist %2\ctl3d.dll goto skipctl3d copy ctl3d.dll %2 :skipctl3d del ctl3d.dll :skipdlls rem emtexgi: deal with 16/32 bit variants if %1 == 31 goto cfg31 del \emtex\mytex\emtexgi.exe del \emtex\mytex\emtexgi.cfg goto cfgdone :cfg31 del \emtex\mytex\emtexgi2.exe del \emtex\mytex\emtexgi2.cfg :cfgdone rem fix dvips if not exist \emtex\data\dvips\config.ps goto nopsdir copy \emtex\data\dvips\config.ps \emtex\data\dvips\config.bak copy \emtex\data\dvips\ljh.cfg \emtex\data\dvips\ljh.bak del \emtex\data\dvips\config.ps del \emtex\data\dvips\ljh.cfg copy \emtex\mytex\config.ps \emtex\data\dvips copy \emtex\mytex\ljh.cfg \emtex\data\dvips del \emtex\mytex\config.ps del \emtex\mytex\ljh.cfg goto psok2 :nopsdir cls echo *** echo Dvips data directory not found. If you mean to echo use dvips you should refer back to the documentation, echo acquire the relevant files, and run emtex.bat echo again. (ctrl-c to abort) echo *** pause :psok2 rem emtexgi: deal with dviwin files rem first dviwin.ini if %1 == 31 goto ini31 if not exist %2\..\dviwin2.ini goto no95ini echo *** echo You already have a dviwin2.ini file. I will copy it echo to %2\..\dviwin2.bak before overwriting it. echo *** pause copy %2\..\dviwin2.ini %2\..\dviwin2.bak del %2\..\dviwin2.ini :no95ini copy \emtex\mytex\dviwin2.ini %2\..\dviwin2.ini del \emtex\mytex\dviwin.ini del \emtex\mytex\dviwin2.ini goto doneini :ini31 if not exist %2\..\dviwin.ini goto no31ini echo *** echo You already have a dviwin.ini file. I will copy it echo to %2\..\dviwin.bak before overwriting it. echo *** pause copy %2\..\dviwin.ini %2\..\dviwin.bak del %2\..\dviwin.ini :no31ini copy \emtex\mytex\dviwin.ini %2\..\dviwin.ini del \emtex\mytex\dviwin.ini del \emtex\mytex\dviwin2.ini :doneini rem then genpk.bat if not exist \dvidrvrs\genpk.bat goto errmsg2 copy \dvidrvrs\genpk.bat \dvidrvrs\genpk.bak del \dvidrvrs\genpk.bat if not exist \emtex\mytex\genpk.bat goto errmsg2 copy \emtex\mytex\genpk.bat \dvidrvrs del \emtex\mytex\genpk.bat rem emtexgi: bin stuff rem if not exist \emtex\bin\nul goto errmsg2 copy \emtex\mytex\bin\*.* \emtex\bin del \emtex\mytex\bin\*.bat del \emtex\mytex\bin\*.exe del \emtex\mytex\bin\*.pif rmdir \emtex\mytex\bin .\unzip \emtex\mytex\dvicopy.zip -d \ del \emtex\mytex\dvicopy.zip rem emtexgi: miscellaneous copy \emtex\mytex\texcad.opt \emtex\bin copy \emtex\mytex\texcad.pif \emtex\bin del \emtex\mytex\texcad.opt del \emtex\mytex\texcad.pif rem if not exist \emtex\mfinput\etc\nul goto errmsg2 copy \emtex\mytex\plain.ini \emtex\mfinput\etc copy \emtex\mytex\cm.ini \emtex\mfinput\etc del \emtex\mytex\plain.ini del \emtex\mytex\cm.ini copy \emtex\mytex\ps2pk.doc \emtex\doc\english del \emtex\mytex\ps2pk.doc if not exist \rsx\bin\rsxwin.ini goto rsxwin1 echo Copying existing rsxwin.ini to rsxwin.bak... copy \rsx\bin\rsxwin.ini \rsx\bin\rsxwin.bak :rsxwin1 copy \emtex\mytex\rsxwin.ini \rsx\bin del \emtex\mytex\rsxwin.ini if not exist \emtex\texinput\babel\hyphen.cfg goto nobabel copy \emtex\texinput\etc\hyphen.tex \emtex\texinput\etc\hyphen.bak del \emtex\texinput\etc\hyphen.tex :nobabel if not exist \emtex\mfinput\etc\local.mf goto errmsg2 copy \emtex\mfinput\etc\local.mf \emtex\mfinput\etc\local.bak del \emtex\mfinput\etc\local.mf copy \emtex\mytex\local.mf \emtex\mfinput\etc del \emtex\mytex\local.mf rem if not exist \emtex\texinput\etc\nul goto errmsg2 copy \emtex\mytex\doublesp.sty \emtex\texinput\etc del \emtex\mytex\doublesp.sty if not exist \emtex\texinput\latex2e\sample2e.tex goto errmsg2 copy \emtex\texinput\latex2e\sample2e.tex \emtex\mytex if not exist \emtex\texinput\etc\gh.tex goto noghtex copy \emtex\texinput\etc\gh.tex \emtex\texinput\etc\gh.bak del \emtex\texinput\etc\gh.tex copy \emtex\mytex\gh.tex \emtex\texinput\etc del \emtex\mytex\gh.tex :noghtex rem Support long filenames under win95 if %1 == 31 goto endrsxopt \rsx\bin\rsxopt -a \emtex\bin\tex386.exe -RO if not exist \emtex\bin\bibtex32.exe goto nobibtex \rsx\bin\rsxopt -a \emtex\bin\bibtex32.exe -RO :nobibtex if not exist \emtex\bin\dvips32.exe goto endrsxopt rem \rsx\bin\rsxopt -a \emtex\bin\dvips32.exe -RO :endrsxopt rem If there's no autoexec.bat, perhaps we can write one? if exist \autoexec.bat goto autonext echo *** echo You don't seem to have an autoexec.bat file. I will echo put one in place, in \. You may have to edit it. echo *** pause copy \emtex\mytex\autoexec.bit \autoexec.bat goto autodone :autonext echo *** echo You already have an autoexec.bat file. You should add echo the material in \emtex\mytex\autoexec.bit to this echo file before attempting to run emtex. (Also please echo be sure to remove any conflicting TeX-related echo statements from your existing autoexec.bat.) echo *** pause :autodone echo *** echo So far as I can tell, installation has been successful. echo Now please refer to the documentation for modifying your echo autoexec.bat file for use with the emTeX system. echo *** pause goto end :errmsg1 echo *** echo Sorry, we seem to be missing one or more essential files echo from the following list: first.zip, fontcm.zip, fontltx.zip, echo l2input.zip, rsx521b.zip, mf4b.zip, tex4b.zip, dviwin29.zip, echo rsxwin31.zip, emtexgi.zip, unzip.exe. Please ensure you have echo all of these in the current directory and try again. echo *** goto end :errmsg2 echo *** echo Sorry, but something seems to have gone wrong. I can't echo find a file or directory that should have been created as echo part of the installation process. The most likely reason echo for this is that one or more of the zipfiles you down- echo loaded somehow got corrupted. You can check the files by echo typing "unzip -l filename.zip" at a DOS prompt (substituting echo a "real" filename for "filename"): If the file is OK, echo you will see a listing of its contents. echo *** goto end :missparam echo *** echo You must specify Windows 3.1 or Windows 95/NT by using the echo parameter 31 or 95 to emtex.bat. Please try again. echo *** goto end :nosysdir echo *** echo You must specify the path to your Windows system directory echo as a second parameter to emtex.bat. Please try again. echo *** goto end :nodll95 echo *** echo Can't find dll95.zip. You may need the dlls from this file echo to run the 32-bit version of emtexgi. We can proceed without echo them for now, or press ctrl-c to abort. echo *** pause goto skipdlls :nodll31 echo *** echo Can't find dll31.zip. You may need the dlls from this file echo to run the 16-bit version of emtexgi. We can proceed without echo them for now, or press ctrl-c to abort. echo *** pause goto skipdlls :end