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

:: This program will manually install windows drivers

:: if invoked as 'manwsedd', show syntax

	if "%1" == ""				goto syntax
	if "%2" == ""				goto syntax
	if not exist %1\install.exe		goto baddir
	if not exist %2\win.ini			goto baddir

::win.ini
	sedit -wI %2 win.ini windows run %1\mvin.exe s

::system.ini
	copy %1\msoftrs\midisoft.ini %2
	copy %1\msoftsi\audio.ini    %2
	sedit -wnqI %2 system.ini drivers wave pa3dwave.drv	s
	sedit -wnqI %2 system.ini drivers mixer pa3dmxd.drv	s
	sedit -wnqI %2 system.ini drivers midi mvifm.drv	s
	sedit -wnqI %2 system.ini 386Enh device=+vpa3dd.386 vpa3dd.386 s
	sedit -wnqI %2 system.ini mci cdaudio mcicda.drv	s
	sedit -wnqI %2 system.ini 386Enh dmabuffersize 064	s
	sedit -wnqI %2 system.ini pa3dwave.drv port 220	s
	sedit -wnqI %2 system.ini pa3dwave.drv	int 7	s
	sedit -wnqI %2 system.ini pa3dwave.drv	dmachannel 1	s
	sedit -wnqI %2 system.ini pa3dwave.drv	dmachannel2 7	s
	sedit -wnqI %2 system.ini boot drivers "mmsystem.dll msmixmgr.dll mmmixer.dll" s
	sedit -wnqI %2 system.ini drivers midi1 pa3d401.drv	s
	sedit -wnqI %2 system.ini pa3d401.drv int  2 	s
	sedit -wnqI %2 system.ini pa3d401.drv port 320 	s
	sedit -wnqI %2 system.ini pa3d401.drv board 0 	s

::mv.ini
	sedit -wnqI %2 win.ini windows run %1\mvin.exe replace
	sedit -wnqI %2 mv.ini mvinit mvdirectory %1 substitute
	sedit -wnqI %2 mv.ini mvinit group1 "%1,mv.grp,Multimedia Applications" substitute

	sedit -wnqI %2 mv.ini "Multimedia Applications" file1 "%1\monolog\mono_16.exe,Monologue for Windows" substitute
	sedit -wnqI %2 mv.ini "Multimedia Applications" file2 "%1\monolog\dictmgr.exe,Dictionary Manager" substitute
	sedit -wnqI %2 mv.ini "Multimedia Applications" file3 "%1\msoftrs\session.exe,MidiSoft Recording Session" substitute
	sedit -wnqI %2 midisoft.ini SetupInfo SE_SetupPath %1\msoftrs replace
	sedit -wnqI %2 midisoft.ini SetupInfo SE_LastRunFrom %1\msoftrs\session.exe replace
	sedit -wnqI %2 mv.ini "Multimedia Applications" file4 "%1\msoftsi\audiosim.exe,MidiSoft Sound Impression" substitute
	sedit -wnqI %2 audio.ini SetupInfo SetupPath %1\msoftsi replace
	sedit -wnqI %2 audio.ini SetupInfo LastRunFrom %1\msoftsi\audiosim.exe replace
	sedit -wnqI %2 audio.ini SetupInfo MidiEditor RecordingSession replace
	sedit -wnqI %2 mv.ini "Multimedia Applications" file5 "%1\msoftsi\audiored.exe,MidiSoft Sound Impression Wave Editor" substitute
	sedit -wnqI %2 mv.ini "Multimedia Applications" file6 "%1\msoftsi\audiohlp.hlp,MidiSoft Sound Impression Help" substitute

	goto quit

:syntax
	echo Syntax: manwsedd targetdir windowsdir 
	echo This program will manually install the drivers for windows
	echo Example:  manwsedd c:\reno c:\windows
	echo 		where c:\reno is Reno directory.
	echo 		where c:\windows is windows directory.
	goto quit

:baddir
	echo Could not locate directory

:quit
	



