home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 28 Fixes4x / 28-Fixes4x.zip / v4rsu.zip / instapar.cmd < prev    next >
OS/2 REXX Batch file  |  1997-10-14  |  4KB  |  118 lines

  1. /******************************************************************************/
  2. /* REXX PROGRAM to install the TCP/IP stack files for the latest Merlin APAR  */
  3. /* TCP/IP Level 3 Service                                                     */
  4. /*                                                                            */
  5. /* Last modification: 10/14/1997  Sweeney   Change check for MPTS CSD WRx84xx  */
  6. /******************************************************************************/
  7. parse source args
  8. call rxfuncadd 'sysloadfuncs','rexxutil','sysloadfuncs'
  9. call sysloadfuncs
  10.   Call RxFuncAdd 'SysLvlLoadFuncs' , 'SYSLVL' , 'SysLvlLoadFuncs'
  11.  
  12.   Call SysLvlLoadFuncs , 'SYSLVL' , 'SysLvlLoadFuncs'
  13.  
  14. /* Get drive & path for \MPTN\, \TCPIP\, and \IBMCOM\ from the PATH environment
  15.    variable
  16.  */
  17.  
  18. '@echo off'
  19.  
  20. PathVal = value('PATH',,'os2environment')    /* get PATH variable */
  21.  
  22. /* Make sure the PATH has a terminating semicolon */
  23. if substr(PathVal,length(PathVal),1)<>';' then PathVal = PathVal';'
  24.  
  25. MPTNPath=''
  26. TCPath=''
  27. IBMCPath=''
  28.  
  29. do forever
  30.   parse upper value PathVal with frontpart ';' backpart
  31.  
  32.   if (substr(frontpart,3,5) = '\MPTN' &MPTNPATH="" ) then do
  33.     MPTNPath = substr(frontpart,1,7)
  34.     end
  35.  
  36.   if ((substr(frontpart,3,6) = '\TCPIP') & TCPath="") then do
  37.     TCPath=substr(frontpart,1,8)
  38.     end
  39.  
  40.   if (substr(frontpart,3,7) = '\IBMCOM' & IBMCPath="") then do
  41.     IBMCPath = substr(frontpart,1,9)
  42.     end
  43.  
  44.   if backpart = '' then do
  45.     leave
  46.     end
  47.  
  48.   PathVal = backpart
  49. end
  50.  
  51. /* Verify that all the paths were found */
  52.  
  53. if MPTNPath='' | TCPath='' | IBMCPath='' then do
  54.   "wrongpth.exe"
  55.   exit 1
  56. end
  57.  
  58. /* Verify the customer's MPTS level before updating the stack */
  59.  
  60. Call GetSysVersion MPTNPath'\syslevel.mpt'
  61. ver = substr(result,1,3)
  62. if ver <> "5.1" then        /* 5.10, 5.11, ... */
  63. do
  64.   "wrongver.exe"
  65.   exit 1
  66. end
  67.  
  68. Call GetCSDLevel MPTNPath'\syslevel.mpt'
  69. csd = substr(result,1,2) || 'x' || substr(result,4,2)
  70. country = substr(result,3,1)    /* 0 = USA, U = UK, ... */
  71.  
  72. if csd <> "WRx84" then      /* WRx8400, WRx8410, WRx8415, ... */
  73. do
  74.   "wrongcsd.exe"
  75.   exit 1
  76. end
  77.  
  78. /* Verifications were successful. Update the stack files */
  79.  
  80. tcprep "afinet.sys "|| MPTNPath ||"\protocol"
  81. tcprep "afos2.sys "|| MPTNPath ||"\protocol"
  82. tcprep "ifndis.sys "|| MPTNPath ||"\protocol"
  83. tcprep "sockets.sys "|| MPTNPath ||"\protocol"
  84.  
  85. tcprep "so32dll.dll "|| MPTNPath ||"\dll"
  86. tcprep "tcp32dll.dll "|| MPTNPath ||"\dll"
  87. if country = 0 then tcprep "tcpmri.dll "|| MPTNPath ||"\dll"
  88. tcprep "tcptime.dll "|| MPTNPath ||"\dll"
  89.  
  90. tcprep "arp.exe "|| MPTNPath ||"\bin"
  91. tcprep "cntrl.exe "|| MPTNPath ||"\bin"
  92. tcprep "host.exe "|| MPTNPath ||"\bin"
  93. tcprep "hostid.exe "|| MPTNPath ||"\bin"
  94. tcprep "ifconfig.exe "|| MPTNPath ||"\bin"
  95. tcprep "inetcfg.exe "|| MPTNPath ||"\bin"
  96. tcprep "inetdbg.exe "|| MPTNPath ||"\bin"
  97. tcprep "inetwait.exe "|| MPTNPath ||"\bin"
  98. tcprep "ipformat.exe "|| MPTNPath ||"\bin"
  99. tcprep "ipgate.exe "|| MPTNPath ||"\bin"
  100. tcprep "iptrace.exe "|| MPTNPath ||"\bin"
  101. tcprep "netstat.exe "|| MPTNPath ||"\bin"
  102. tcprep "ping.exe "|| MPTNPath ||"\bin"
  103. tcprep "route.exe "|| MPTNPath ||"\bin"
  104. tcprep "syndef.exe "|| MPTNPath ||"\bin"
  105.  
  106. tcprep "routed.exe "|| TCPath ||"\bin"
  107.  
  108. tcprep "tcpip.nif "|| IBMCPath ||"\protocol"
  109. tcprep "tcpipdll.dll "|| MPTNPath ||"\dll"
  110.  
  111. /* Prevent new tcpipdll.dll from being overwritten */
  112. address cmd "erase" TCPath ||"\archive\dll\tcpipdll.dll"
  113.  
  114. Call ReleaseMemory
  115. "mess.exe"
  116.  
  117. exit
  118.