@echo off
set TARGET=.

echo This program installs CodeView for Windows.  It requires two
echo diskettes from the Microsoft C/C++ 7.0 release.  A decompression
echo utility is copied from the diskette labelled "Microsoft Source
echo Profiler Setup", and CodeView for Windows is copied from the diskette
echo labelled "Microsoft C/C++ Disk 7".

if not x%2==x set TARGET=%2
set DRIVE=
if x%1==xa set drive=A:
if x%1==xA set drive=A:
if x%1==xa: set drive=A:
if x%1==xA: set drive=A:
if x%1==xb set drive=B:
if x%1==xB set drive=B:
if x%1==xb: set drive=B:
if x%1==xB: set drive=B:
if not x%drive%==x goto args_ok
echo.
echo Usage: %0 Drive [Dest. Directory]
echo       Drive should be either "A:" or "B:".  The default destination
echo       directory is the current directory.
goto retrun
:args_ok

if exist %TARGET%\cl.exe goto ok1
echo.
echo The destination directory does not appear to be a C/C++ BIN directory.
echo Press any key to continue, or press Control-C to return to DOS.
pause > nul
:ok1

if not exist %TARGET%\cvw4.exe goto ok2
echo.
echo CVW4.EXE is already present in the destination directory.
echo Press any key to continue, or press Control-C to return to DOS.
pause > nul
:ok2

if exist %TARGET%\decomp.exe goto got_decomp
:get_decomp
echo.
echo Please insert the diskette labelled "Microsoft Source Profiler"
echo into drive %DRIVE% and press any key to continue.
pause > nul
if not exist %DRIVE%\decomp.exe goto get_decomp

copy %DRIVE%\decomp.exe %TARGET%\decomp.exe
:got_decomp

:get_cvw
echo.
echo Please insert the diskette labelled "Microsoft C/C++ Disk 7"
echo into drive %DRIVE% and press any key to continue.
pause > nul
if not exist %DRIVE%\bin\CVW4.EX$ goto get_cvw


echo on
%TARGET%\decomp -f %DRIVE%\bin\CVW4.EXE %TARGET%\CVW4.EXE
%TARGET%\decomp -f %DRIVE%\bin\EEW0CAN.DLL %TARGET%\EEW0CAN.DLL
%TARGET%\decomp -f %DRIVE%\bin\EEW0CXX.DLL %TARGET%\EEW0CXX.DLL
%TARGET%\decomp -f %DRIVE%\bin\EMW0W0.DLL %TARGET%\EMW0W0.DLL
%TARGET%\decomp -f %DRIVE%\bin\SHW0.DLL %TARGET%\SHW0.DLL
:retrun
