@echo off rem Update.bat -- I am a batch file to update emtexgi. rem I require two parameters, namely "31" for 16-bit rem Windows or "95" for 32-bit Windows, and the path to rem your Windows system directory for 32-bit DLLs, rem e.g. c:\windows\system, c:\winnt351\system32 if %1. == . goto errmsg0 rem Check for common needed files if not exist unzip.exe goto errmsg3 if not exist emtexgi.zip goto errmsg3 if %1 == 31 goto 32ok if %2. == . goto errmsg1 if not exist %2\nul goto errmsg2 if exist dll95.zip goto query5 :need32 if not exist dll95.zip goto query0 if not exist rsx521b.zip goto query1 if not exist rsxwin31.zip goto query1 rem Block of code relevant only if going to 32-bit rem version for first time. echo Setting up rsx and rsxwin... unzip -jo rsx521b.zip RSX/BIN/RSX.EXE -d \rsx\bin unzip -jo rsx521b.zip RSX/BIN/RSXOPT.EXE -d \rsx\bin unzip -jo rsxwin31.zip RSXWIN/BIN/RSXWIN.EXE -d \rsx\bin unzip -jo rsxwin31.zip RSXWIN/BIN/RSXIO.DLL -d \rsx\bin unzip -jo rsxwin31.zip RSXWIN/DOC/RSXWIN.HLP -d \rsx\bin echo Configuring programs for long filenames... \rsx\bin\rsxopt -a %emtexdir%\bin\tex386.exe -RO if not exist %emtexdir%\bin\bibtex32.exe goto nobibtex \rsx\bin\rsxopt -a %emtexdir%\bin\bibtex32.exe -RO :nobibtex if not exist %emtexdir%\bin\dvips32.exe goto norsxopt rem \rsx\bin\rsxopt -a %emtexdir%\bin\dvips32.exe -RO :norsxopt rem Now do the DLLs etc. unzip emtexgi.zip REGSVR32.EXE unzip dll95.zip echo Checking for required DLLs... rem vb40032 if exist %2\vb40032.dll goto skipvb400 copy vb40032.dll %2 regsvr32 /s %2\vb40032.dll :skipvb400 del vb40032.dll rem commdlg if exist %2\comdlg32.ocx goto skipocx copy comdlg32.ocx %2 regsvr32 /s %2\comdlg32.ocx :skipocx del comdlg32.ocx rem ven if exist %2\ven2232.olb goto skipven copy ven2232.olb %2 regsvr32 /s %2\ven2232.olb :skipven del ven2232.olb rem olepro32 if exist %2\olepro32.dll goto skipole copy olepro32.dll %2 regsvr32 /s %2\olepro32.dll :skipole del olepro32.dll rem msvcrt20 if exist %2\msvcrt20.dll goto skip20 copy msvcrt20.dll %2 regsvr32 /s %2\msvcrt20.dll :skip20 del msvcrt20.dll rem msvcrt40 if exist %2\msvcrt40.dll goto skip40 copy msvcrt40.dll %2 regsvr32 /s %2\msvcrt40.dll :skip40 del msvcrt40.dll rem mfc40 if exist %2\mfc40.dll goto skipmfc copy mfc40.dll %2 regsvr32 /s %2\mfc40.dll :skipmfc del mfc40.dll del regsvr32.exe rem End of new-to-32-bit-specific code. :32ok rem Do the *common* unzipping echo Checking for new packages to install... if not exist graphics.zip goto nographics unzip graphics.zip -d %emtexdir%\texinput unzip emtexgi.zip EMTGRFX.INS copy emtgrfx.ins %emtexdir%\texinput\graphics rem del emtgrfx.ins :nographics if not exist babel.zip goto nobabel unzip babel.zip -d \ if not exist %emtexdir%\texinput\hyphen.tex goto nobabel copy %emtexdir%\texinput\etc\hyphen.tex %emtexdir%\texinput\etc\hyphen.bak del %emtexdir%\texinput\etc\hyphen.tex :nobabel if not exist hyphen.zip goto nohyphen unzip hyphen.zip -d \ :nohyphen if not exist amsfiles.zip goto noamsfiles unzip amsfiles.zip -d \ :noamsfiles if not exist ispell.zip goto endispell unzip ispell.zip -d \ :endispell if not exist first.zip goto nofirstzip unzip first.zip -d \ :nofirstzip echo Checking for new LaTeX2e... if not exist l2input.zip goto endl2input unzip l2input.zip -d \ if not exist %emtexdir%\btexfmts\latex.fmt goto endl2input del %emtexdir%\btexfmts\latex.fmt :endl2input if not exist l2tools.zip goto nol2tools unzip l2tools.zip -d \ :nol2tools echo Checking for updated emTeX executables... if not exist mf4b.zip goto nomf4b unzip -o mf4b.zip emtex/bin/mf386.exe -d \ unzip -o mf4b.zip emtex/remove/*.* -d \ :nomf4b if not exist tex4b.zip goto endtex4b unzip -o tex4b.zip emtex/bin/tex386.exe -d \ unzip -o tex4b.zip emtex/remove/*.* -d \ if %1 == 31 goto endtex4b rsxopt -a %emtexdir%\bin\tex386.exe -RO :endtex4b echo Updating manual... if not exist %emtexdir%\mytex\emtexgi.dvi goto nodeldvi del %emtexdir%\mytex\emtexgi.dvi :nodeldvi unzip -o emtexgi.zip EMTEXGI.TEX -d %emtexdir%\mytex echo Checking for rsxwin.ini... rem rsxwin.ini if not exist \rsx\bin\rsxwin.exe goto query3 if exist \rsx\bin\rsxwin.ini goto query4 unzip emtexgi.zip RSXWIN.INI -d \rsx\bin goto rsxdone :rsxok unzip -o emtexgi.zip RSXWIN.INI :rsxdone if %1 == 31 goto exe31 copy %emtexdir%\mytex\emtexgi2.exe %emtexdir%\mytex\emtexgi2.bak unzip -o emtexgi.zip EMTEXGI2.EXE -d %emtexdir%\mytex if exist %emtexdir%\mytex\emtexgi2.cfg goto cfgmsg if not exist %emtexdir%\mytex\emtexgi.cfg goto newcfg copy %emtexdir%\mytex\emtexgi.cfg %emtexdir%\mytex\emtexgi2.cfg goto donecfg :newcfg unzip emtexgi.zip EMTEXGI2.CFG -d %emtexdir%\mytex :donecfg goto exedone :exe31 copy %emtexdir%\mytex\emtexgi.exe %emtexdir%\mytex\emtexgi.bak unzip -o emtexgi.zip EMTEXGI.EXE -d %emtexdir%\mytex if exist %emtexdir%\mytex\emtexgi.cfg goto cfgmsg2 unzip emtexgi.zip EMTEXGI.CFG -d %emtexdir%\mytex :exedone rem Fix dviwin help file if possible if not exist \dvidrvrs\dviwin.hlp goto helpok if %1 == 31 goto help31 if exist %emtexdir%\bin\dviwin2.hlp goto helpok copy \dvidrvrs\dviwin.hlp %emtexdir%\bin\dviwin2.hlp goto helpok :help31 if exist %emtexdir%\bin\dviwin.hlp goto helpok copy \dvidrvrs\dviwin.hlp %emtexdir%\bin\dviwin.hlp :helpok echo Updating seems to have been successful. goto end :query0 echo I can't find dll95.zip. Perhaps you have already installed echo these DLLs (i.e. you already have a functioning version echo of emtexgi2.exe). If that is *not* the case, press ctrl-c echo to abort, get dll95.zip, and try again. pause goto 32ok :query1 echo I can't find rsxwin31.zip or rsx521b.zip. You need these echo only if you are updating to emtexgi2.exe (32-bit version echo of emtexgi) for the first time, so perhaps it's not a echo problem. If it *is* a problem, press ctrl-c to abort, get echo the needed files, and try again. pause goto 32ok :query3 echo I can't find rsxwin. Maybe you have a non-standard directory echo structure. If you want to install rsxwin.ini you'll have to echo do so manually: copy rsxwin.ini from this directory to echo the directory where rsxwin.exe lives. (This is to support echo emtex's "e" feature, to take you to the location of a LaTeX echo syntax error.) pause goto rsxok :query4 echo You already have an rsxwin.ini file. You might want to take echo a look at the copy you'll find in the current directory, echo which defines "emtexed" in such a way as to support the echo automatic location of syntax errors, with PFE as editor, echo when you press "e" on a LaTeX compilation error. pause goto rsxok :query5 echo Found dll95.zip inthe current directory. If you have echo already successfully installed the contents of this echo zipfile you should probably delete or move it before running echo this update routine (so do ctrl-c to abort this program). echo Otherwise just go ahead. pause goto need32 :cfgmsg echo You already have a copy of emtexgi2.cfg. I won't overwrite echo it, but you may want to take a look at the current default echo version in emtexgi.zip. pause goto donecfg :cfgmsg2 echo You already have a copy of emtexgi.cfg. I won't overwrite echo it, but you may want to take a look at the current default echo version in emtexgi.zip. pause goto exedone :errmsg0 echo You have to specify 31 or 95 as a first parameter echo to update.bat (for 16- or 32-bit Windows respectively). goto end :errmsg1 echo You need to specify the path to your Windows system echo directory for 32-bit DLLs -- e.g. c:\windows\system, or echo c:\winnt351\system32 -- as a second parameter to update.bat. goto end :errmsg2 echo Sorry, I can't find the Windows system directory you echo specified. Please try again. goto end :errmsg3 echo Can't find either unzip.exe or emtexgi.zip. Please place echo these files in the current directory and try again. :end