home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 4 Drivers / 04-Drivers.zip / CS4231.ZIP / WIN_INST.CMD < prev   
OS/2 REXX Batch file  |  1994-09-29  |  3KB  |  114 lines

  1. /**/
  2. '@echo off'
  3. call rxfuncadd sysloadfuncs,rexxutil,sysloadfuncs
  4. call sysloadfuncs
  5.  
  6.  
  7. arg windir os2drive
  8. if (compare(windir,"")=0) | (compare(os2drive,"")=0) then
  9. do
  10.         say
  11.         say "usage: WIN_INST.CMD WINDIR OS2DRIVE"
  12.         say
  13.         say "where WINDIR is the Windows / WINOS/2 Directory"
  14.         say "and OS2DRIVE is the Drive on which OS/2 is installed."
  15.         return
  16. end
  17.  
  18. call sysfiletree windir,winlist
  19. errors=0
  20. if winlist.0=0 then
  21. DO
  22.         say 'Error: 'windir' is an invalid Windows Directory'
  23.         errors=1
  24. END
  25. os2dir=left(os2drive,1)':\OS2\MDOS\'
  26. call sysfiletree os2dir,os2list
  27. if os2list.0=0 then
  28. DO
  29.         say 'Error: 'os2drive' is an invalid OS2 Drive'
  30.         errors=1
  31. END
  32.  
  33. if compare(right(windir,1),'\')<>0 then
  34.         windir=windir'\'
  35.  
  36. if errors=0 then
  37. DO
  38.     call sysfiletree 'cs31ba11.ini',csfile
  39.     if csfile.0=0 then
  40.     DO
  41.             say 'Error: file CS31BA11.INI was not found'
  42.             errors=1
  43.     END
  44.     call sysfiletree 'cs31ba11.drv',csfile
  45.     if csfile.0=0 then
  46.     DO
  47.             say 'Error: file CS31BA11.DRV was not found'
  48.             errors=1
  49.     END
  50.     call sysfiletree 'tp750ini.add',csfile
  51.     if csfile.0=0 then
  52.     DO
  53.             say 'Error: file TP750INI.ADD was not found'
  54.             errors=1
  55.     END
  56.     call sysfiletree 'vsndsys.386',csfile
  57.     if csfile.0=0 then
  58.     DO
  59.             say 'Error: file VSNDSYS.386 was not found'
  60.             errors=1
  61.     END
  62.     call sysfiletree 'vdma.sys',csfile
  63.     if csfile.0=0 then
  64.     DO
  65.             say 'Error: file VDMA.SYS was not found'
  66.             errors=1
  67.     END
  68. END
  69.  
  70.  
  71. if errors>0 then
  72. do
  73.         say
  74.         say "usage: WIN_INST.CMD WINDIR OS2DRIVE"
  75.         say
  76.         say "where WINDIR is the Windows / WINOS/2 Directory"
  77.         say "and OS2DRIVE is the Drive on which OS/2 is installed."
  78.         return
  79. end
  80.  
  81. copy 'CS31BA11.INI' windir' > NUL'
  82. copy 'CS31BA11.DRV' windir'system > NUL'
  83. copy 'VSNDSYS.386' windir'system > NUL'
  84. copy 'VDMA.SYS' os2dir' > NUL'
  85. copy windir'system.ini' windir'system.bak > NUL'
  86. attrib '-r 'windir'system.ini'
  87. erase windir'system.ini'
  88. line=linein(windir'system.bak',1,0)
  89. mode=0
  90. do while lines(windir'system.bak')<>0
  91.         cline=linein(windir'system.bak')
  92.         call lineout windir'system.ini',cline
  93.         push cline
  94.         parse upper pull cl
  95.         if compare('[DRIVERS]',left(cl,9))=0 then
  96.         do
  97.                 call lineout windir'system.ini','Wave=CS31BA11.DRV'
  98.                 call lineout windir'system.ini','Aux=CS31BA11.DRV'
  99.                 call lineout windir'system.ini','Mixer=CS31BA11.DRV'
  100.         end
  101.         if compare('[386ENH]',left(cl,8))=0 then
  102.                 call lineout windir'system.ini','Device=vsndsys.386'
  103. end
  104. /* call lineout windir'system.ini' */
  105. call lineout windir'system.ini',''
  106. call lineout windir'system.ini',';The Following lines have been added from TP750INI.ADD'
  107. call lineout windir'system.ini'
  108. copy windir'system.ini+TP750INI.ADD' windir'system.ini > NUL'
  109.  
  110. say
  111. say "WINDOWS has been updated successfully."
  112. say "SYSTEM.INI has been modified, a backup can be found in SYSTEM.BAK"
  113. say "The system needs to be rebooted for changes to take effect."
  114.