/*  PATCH.CMD
*/
 
say "Patching files..."
if( Stream("VROBJ.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VROBJ.A" 
end
if( Stream("VREDIT.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VREDIT.A" 
end
if( Stream("VRSED.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRSED.A" 
end
if( Stream("MACROS.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\MACROS.A" 
end
if( Stream("DBIDB22.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\DBIDB22.A" 
end
if( Stream("DBIODBC.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\DBIODBC.A" 
end
if( Stream("DBIWSQL.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\DBIWSQL.A" 
end
if( Stream("QUERYED.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\QUERYED.A" 
end
if( Stream("VRCHT.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRCHT.A" 
end
if( Stream("VRCHTC.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRCHTC.A" 
end
if( Stream("VRCHTD.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRCHTD.A" 
end
if( Stream("VRCHTM.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRCHTM.A" 
end
if( Stream("VRCHTR.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRCHTR.A" 
end
if( Stream("VRCHTW.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRCHTW.A" 
end
if( Stream("VRDB.DLL", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\DLL\VRDB.A" 
end
if( Stream("README.INF", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\INF\README.A" 
end
if( Stream("README2.INF", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\INF\README2.A" 
end
if( Stream("A2Z.INF", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\INF\A2Z.A" 
end
if( Stream("PROGGUID.INF", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\INF\PROGGUID.A" 
end
if( Stream("VRDB.INF", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\INF\VRDB.A" 
end
if( Stream("VRXEDIT.EXE", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\EXE\VRXEDIT.A" 
end
if( Stream("PMDBG.EXE", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\EXE\PMDBG.A" 
end
if( Stream("PMEXE.EXE", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\EXE\PMEXE.A" 
end
if( Stream("BINDDBI.EXE", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\EXE\BINDDBI.A" 
end
if( Stream("DBADMIN.EXE", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\EXE\DBADMIN.A" 
end
if( Stream("QUERYED.HLP", "C","QUERY EXISTS" ) \= "" ) then do
    "@bpatch -p APATCHES\HLP\QUERYED.A" 
end
 
say 'A number of files are no longer needed.'
say 'Do you want to delete them (you will be prompted for each) [y|n]?'
parse upper pull response
if( Left( response, 1 ) = 'Y' ) then do
    say 'Delete BUILDVRX.FUL (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase BUILDVRX.FUL'
    say 'Delete BINDDBI.BND (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase BINDDBI.BND'
    say 'Delete DB22CONN.BND (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase DB22CONN.BND'
    say 'Delete DB22DB.BND (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase DB22DB.BND'
    say 'Delete DB22EXEC.BND (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase DB22EXEC.BND'
    say 'Delete VRCHTDEL.CMD (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase VRCHTDEL.CMD'
    say 'Delete MACROS\SETTABS.VRM (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase MACROS\SETTABS.VRM'
    say 'Delete MACROS\SETTABS.VRW (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase MACROS\SETTABS.VRW'
    say 'Delete CHTSAMP\CHTEDIT\CHTEDIT.VRP (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CHTEDIT\CHTEDIT.VRP'
    say 'Delete CHTSAMP\CHTEDIT\CHTEDIT.VRX (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CHTEDIT\CHTEDIT.VRX'
    say 'Delete CHTSAMP\CHTEDIT\CHTEDIT.VRY (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CHTEDIT\CHTEDIT.VRY'
    say 'Delete CHTSAMP\CLICK\CLICK.VRM (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CLICK\CLICK.VRM'
    say 'Delete CHTSAMP\CLICK\CLICK.VRW (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CLICK\CLICK.VRW'
    say 'Delete CHTSAMP\CLICK\TMP.CHT (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CLICK\TMP.CHT'
    say 'Delete CHTSAMP\CLICK\WINDOW1.VRM (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CLICK\WINDOW1.VRM'
    say 'Delete CHTSAMP\CLICK\WINDOW1.VRW (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\CLICK\WINDOW1.VRW'
    say 'Delete CHTSAMP\PRINTCHT\PRINTING.EXE (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\PRINTING.EXE'
    say 'Delete CHTSAMP\PRINTCHT\PRINTING.ICO (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\PRINTING.ICO'
    say 'Delete CHTSAMP\PRINTCHT\PRINTING.VRP (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\PRINTING.VRP'
    say 'Delete CHTSAMP\PRINTCHT\WINDOW1.VRM (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\WINDOW1.VRM'
    say 'Delete CHTSAMP\PRINTCHT\WINDOW1.VRW (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\WINDOW1.VRW'
    say 'Delete CHTSAMP\PRINTCHT\WINDOW1.VRX (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\WINDOW1.VRX'
    say 'Delete CHTSAMP\PRINTCHT\WINDOW1.VRY (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\WINDOW1.VRY'
    say 'Delete CHTSAMP\PRINTCHT\WORKER.VRX (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\PRINTCHT\WORKER.VRX'
    say 'Delete CHTSAMP\RMOUSE\RMOUSE.VRM (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\RMOUSE\RMOUSE.VRM'
    say 'Delete CHTSAMP\RMOUSE\RMOUSE.VRW (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\RMOUSE\RMOUSE.VRW'
    say 'Delete CHTSAMP\ROWCOL\ROWCOL.VRM (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\ROWCOL\ROWCOL.VRM'
    say 'Delete CHTSAMP\ROWCOL\ROWCOL.VRW (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase CHTSAMP\ROWCOL\ROWCOL.VRW'
    say 'Delete DBSAMPLE\ORDERAPP\ORDERAPP.ERR (y/n)?'
    parse upper pull response
    if( Left( response, 1 ) = 'Y' ) then 'erase DBSAMPLE\ORDERAPP\ORDERAPP.ERR'
end
 
say "You can now erase the APATCHES directory"
say " "
say "NOTE: If you use DB2/2, you MUST rebind VX-REXX to your databases."

