home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 October / VPR9810B.BIN / IBM_OS / JDK116 / JAVAINRT.ZIP / syslvl.cmd < prev    next >
OS/2 REXX Batch file  |  1998-02-26  |  5KB  |  116 lines

  1. /* rexx */
  2. parse UPPER arg fHandle bootdrive  PATH COMPONENT
  3. file = bootdrive"\kmcrpc10.sl"
  4. tmpfile = test.fi
  5.  
  6. pathlen = LENGTH( PATH)
  7. looking =  SUBSTR(path, 1, pathlen)
  8.  
  9. /* translation strings: */
  10. message1R = "システム上の Java ランタイム・コンポーネントは、インストールするものより新しいバージョンです。それでもインストールしますか?"
  11. message2R = "古いベータまたはアルファ・レベルの Java ランタイム・コンポーネントの上にインストールしようとしています。それでもインストールしますか?"
  12. message1S = "システム上の「サンプル」コンポーネントは、インストールするものより新しいバージョンです。それでもインストールしますか?"
  13. message2S = "古いベータまたはアルファ・レベルの「サンプル」コンポーネントの上にインストールしようとしています。それでもインストールしますか?"
  14. message1T = "システム上の「ツールキット(JDK)」コンポーネントは、インストールするものより新しいバージョンです。それでもインストールしますか?"
  15. message2T = "古いベータまたはアルファ・レベルの「ツールキット(JDK)」コンポーネントの上にインストールしようとしています。それでもインストールしますか?"
  16. message1D = "システム上の ICATJAVA for OS/2 は、インストールするものより新しいバージョンです。それでもインストールしますか?"
  17. message2D = "古いベータまたはアルファ・レベルの ICATJAVA for OS/2 の上にインストールしようとしています。それでもインストールしますか?"
  18.  
  19. call RxFuncAdd 'RexxInstResolveVariables', 'WPINSTAL', 'RexxInstResolveVariables'
  20. call RxFuncAdd 'RexxInstSetVariable', 'WPINSTAL', 'RexxInstSetVariable'
  21. call RxFuncAdd 'RexxInstDeselect', 'WPINSTAL', 'RexxInstDeselect'
  22.  
  23. continue = RexxInstResolveVariables( fHandle, "{Continue}", 1)
  24. if continue = "UNATTENDED" then EXIT
  25.  
  26.  
  27. /*       'syslevel > ' file         */
  28. rc = stream( tmpfile, 'c', 'open read')
  29. rc = stream( tmpfile, 'c', 'close')
  30. say "close tmpfile rc="rc
  31. rc = stream( file, 'c', 'open read')
  32.  
  33. DO while LINES(file)
  34. currline = LINEIN(file)
  35. len = length( currline)
  36. if (len-11) > 0 then check = substr( currline, len-11, 8 )
  37. if check = "SYSLEVEL" then CALL PROCESS
  38. END
  39. EXIT
  40.  
  41.  
  42. PROCESS:
  43.     ext  = substr( currline, len-2, 3 )
  44.     if ext = COMPONENT
  45.          then found =  SUBSTR( currline, 1, pathlen);
  46.          else RETURN;
  47.     PARSE UPPER VAR found found
  48.     if (looking = found) then CALL VERIFY
  49.     RETURN
  50.  
  51. VERIFY:
  52.     nextline = LINEIN(file)
  53.     nextline = LINEIN(file)
  54.     nextline = LINEIN(file)
  55.     len = LENGTH( nextline)
  56.     currentcsd = substr( nextline, len-3, 4)
  57.     if currentcsd = "9999" then CALL 9999;
  58.     else if currentcsd = "4006" then EXIT;
  59.     else if currentcsd >> "4006" then CALL LOWER
  60.     exit
  61.  
  62.  
  63. 9999:   /* ALPHA/BETA level exists:    */
  64.         path = RexxInstResolveVariables( fHandle, "{UserExitPath}", 1)
  65.          if (COMPONENT == "JAV") then
  66.              path'\message' bootdrive fHandle message2R
  67.          else
  68.          if (COMPONENT == "JSP") then
  69.              path'\message' bootdrive fHandle message2S
  70.          else
  71.          if (COMPONENT == "JTK") then
  72.              path'\message' bootdrive fHandle message2T
  73.          else
  74.          if (COMPONENT == "ICA") then
  75.              path'\message' bootdrive fHandle message2D
  76.         continue = RexxInstResolveVariables( fHandle, "{Continue}", 1)
  77.          if continue = "QUIT" then CALL STOP; else EXIT
  78.  
  79.  
  80. LOWER:   /* installing version lower than current version  */
  81.         path = RexxInstResolveVariables( fHandle, "{UserExitPath}", 1)
  82.          if (COMPONENT == "JAV") then
  83.              path'\message' bootdrive fHandle message1R
  84.          else
  85.          if (COMPONENT == "JSP") then
  86.              path'\message' bootdrive fHandle message1S
  87.          else
  88.          if (COMPONENT == "JTK") then
  89.              path'\message' bootdrive fHandle message1T
  90.          else
  91.          if (COMPONENT == "ICA") then
  92.              path'\message' bootdrive fHandle message1D
  93.         continue = RexxInstResolveVariables( fHandle, "{Continue}", 1)
  94.          if continue = "QUIT" then CALL STOP; else EXIT
  95.  
  96.  
  97.  
  98. STOP:
  99.          if (COMPONENT == "JAV") then
  100.          DO
  101.              rc = RexxInstDeselect( fHandle, Runtime);
  102.              keepJAVA11U = RexxInstResolveVariables( fHandle, "{Java11:TlktDocSelected}", 1)
  103.              if ( keepJAVA11U == "NO" )
  104.              then
  105.              rc = RexxInstDeselect( fHandle, Java11U );
  106.          END;
  107.          else
  108.          if (COMPONENT == "JSP") then
  109.              rc = RexxInstDeselect( fHandle, Samples);
  110.          else
  111.          if (COMPONENT == "JTK") then
  112.              rc = RexxInstDeselect( fHandle, Toolkit);
  113.          else
  114.          if (COMPONENT == "ICA") then
  115.              rc = RexxInstDeselect( fHandle, Debugger);
  116.