@echo off
echo off
if "%debug%" == "yes" echo on

	if "%1" == ""	goto syntax
	if "%2" == ""	goto defwin
	if "%2" == "-" 	goto nowin
	
 :windir
	if not exist %2\nul		goto badwindir
	if not exist %2\win.com		goto badwindir
	if not exist %2\system\nul	goto badwindir

	if not exist %1\nul	md %1
	if not exist %1\nul	goto badmvdir

	echo This program will install the Media Vision software into
	echo the directory "%1", then copy the Windows files to "%2".
	echo .
	echo If this is not correct, press CONTROL-C now, else
	pause

 :windir1
	if exist medvsn.1	goto dowindir
	echo Please put Disk #1 in the drive...
	pause
	if not exist medvsn.1	goto windir1

 :dowindir
	copy compress.exe %1
	copy sedit.exe 	  %1

	%1\compress medvsn.1 %1\*.* 			-o -d
	%1\compress medvsn.1 %2\system\*.* 	DLL 	-o -d
	%1\compress medvsn.1 %2\*.* 		INI 	-o -d
	%1\compress medvsn.1 %1\diag\*.*	DIAG	-o -d
	%1\compress medvsn.1 %1\msoftrs\*.*	MSOFTRS	-o -d
	%1\compress medvsn.1 %1\msoftsi\*.*	MSOFTSI	-o -d
	
 :windir2
	echo Please put Disk #2 in the drive...
	pause
	if not exist medvsn.2	goto windir2

	%1\compress medvsn.2 %1\*.* 			-o -d
	%1\compress medvsn.2 %2\system\*.* 	DLL 	-o -d
	%1\compress medvsn.2 %2\*.* 		INI 	-o -d
	%1\compress medvsn.2 %1\diag\*.*	DIAG	-o -d
	%1\compress medvsn.2 %1\msoftrs\*.*	MSOFTRS -o -d
	%1\compress medvsn.2 %1\msoftsi\*.*	MSOFTSI -o -d
	
	%1\sedit -wnqB c:\ autoexec.bat diag "%1\diag\diag.exe -e qcfg -s=quiettestpcm" modify
	echo [setup]>    %1\diag\install.ini
	echo windir=%2\>>%1\diag\install.ini
	goto quit

 :defwin
	if not exist c:\windows\nul		goto baddefwin
	if not exist c:\windows\win.com		goto baddefwin
	if not exist c:\windows\system\nul	goto baddefwin

	if not exist %1\nul	md %1
	if not exist %1\nul	goto badmvdir

	echo This program will install the Media Vision software into
	echo the directory "%1", then copy the Windows files to "C:\WINDOWS".
	echo .
	echo If this is not correct, press CONTROL-C now, else
	pause

 :defwin1
	if exist medvsn.1	goto dodefwin
	echo Please put Disk #1 in the drive...
	pause
	if not exist medvsn.1	goto defwin1

 :dodefwin
	copy compress.exe %1
	copy sedit.exe 	  %1

	%1\compress medvsn.1 %1\*.* 				-o -d
	%1\compress medvsn.1 C:\WINDOWS\system\*.*	DLL 	-o -d
	%1\compress medvsn.1 C:\WINDOWS\*.* 		INI 	-o -d
	%1\compress medvsn.1 %1\diag\*.*		DIAG	-o -d
	%1\compress medvsn.1 %1\msoftrs\*.*		MSOFTRS	-o -d
	%1\compress medvsn.1 %1\msoftsi\*.*		MSOFTSI	-o -d

 :defwin2
	echo Please put Disk #2 in the drive...
	pause
	if not exist medvsn.2	goto defwin2

	%1\compress medvsn.2 %1\*.* 				-o -d
	%1\compress medvsn.2 C:\WINDOWS\system\*.* 	DLL 	-o -d
	%1\compress medvsn.2 C:\WINDOWS\*.* 		INI 	-o -d
	%1\compress medvsn.2 %1\diag\*.*		DIAG	-o -d
	%1\compress medvsn.2 %1\msoftrs\*.*		MSOFTRS	-o -d
	%1\compress medvsn.2 %1\msoftsi\*.*		MSOFTSI	-o -d
	
	%1\sedit -wnqB c:\ autoexec.bat diag "%1\diag\diag.exe -e qcfg -s=quiettestpcm" modify
	echo [setup]>            %1\diag\install.ini
	echo windir=c:\windows\>>%1\diag\install.ini
	goto quit

 :nowin
	if not exist %1\nul	md %1
	if not exist %1\nul	goto badmvdir

	echo This program will install the Media Vision software into
	echo the directory "%1", but not the Windows files.
	echo .
	echo If this is not correct, press CONTROL-C now, else
	pause

 :nowin1
	if exist medvsn.1	goto donowin
	echo Please put Disk #1 in the drive...
	pause
	if not exist medvsn.1	goto nowin1

 :donowin
	copy compress.exe %1
	copy sedit.exe 	  %1

	%1\compress medvsn.1 %1\*.* 			-o -d
	%1\compress medvsn.1 %1\diag\*.*	DIAG	-o -d

 :nowin2
	echo Please put Disk #2 in the drive...
	pause
	if not exist medvsn.2	goto nowin2

	%1\compress medvsn.2 %1\*.* 			-o -d
	%1\compress medvsn.2 %1\diag\*.*	DIAG	-o -d

	%1\sedit -wnqB c:\ autoexec.bat diag "%1\diag\diag.exe -e qcfg -s=quiettestpcm" modify
	echo [setup]>   %1\diag\install.ini
	echo windir=.\>>%1\diag\install.ini
	echo [boot]>    %1\diag\system.ini
	goto quit

 :badwindir
	echo Sorry, but "%2" is not a valid Windows directory.
	echo A Windows directory should have WIN.COM and the SYSTEM directory.
	goto syntax

 :baddefwin
	echo Sorry, but C:\WINDOWS is not a valid Windows directory.
	echo Run this program using the name of the directory holding Windows."
	goto syntax

 :badmvdir
	echo Sorry, but "%1" is not a valid directory.
	echo The attempt to create the directory failed.  Is this a directory?
	dir %1
	goto syntax

 :badmvdef
	echo Sorry, but "C:\MEDVSN" is not a valid directory.
	echo The attempt to create the directory failed.  Is this a directory?
	dir C:\MEDVSN
	goto syntax

 :syntax
	echo Syntax: manual mvdir [windir]
	echo .
	echo Example: install into C:\MEDVSN and C:\WINDOWS
	echo .
	echo   manual c:\medvsn
	echo .
	echo Example: install into C:\USR\SOUND and C:\WINDOWS
	echo .
	echo   manual c:\usr\sound
	echo .
	echo Example: install into D:\MEDVSN and D:\WINDOWS
	echo .
	echo   manual d:\medvsn d:\windows
	echo .
	echo Example: install into C:\MEDVSN but not Windows
	echo .
	echo   manual c:\medvsn -
	echo .
	goto exit
	
 :quit
	smartdrv /c
	echo You may ignore any error about 'Bad command or filename.'
	echo Remove the Installation Disk from the drive.
	echo Reboot your system now, please.

 :exit
