home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Java / Java.zip / javainrt.zip / check.cmd < prev    next >
OS/2 REXX Batch file  |  1998-02-26  |  3KB  |  103 lines

  1. /* check prereqs                                                        */
  2. parse arg hFeature bootdrive where
  3. file = bootdrive'\kmcrpc10'
  4.  
  5. /*  These two messages are the only translatable items in the file:              */
  6. message1="Unicode Font is not present in install package.  Please refer to the Readme for information on downloading the font package."
  7. message2="This system is not at the correct Fix Pack level to utilize the unicode font.  Unicode font will not be installed.  Refer to the Readme for more information about Fix Pack prerequisites."
  8. message3="The version of OS/2 on your system does not meet the prerequisites for installing Java, installation will terminate.  Please refer to the Readme for more details."
  9.  
  10.  
  11.  
  12. call RxFuncAdd 'RexxInstDeselect', 'WPINSTAL', 'RexxInstDeselect'
  13. call RxFuncAdd 'RexxInstResolveVariables', 'WPINSTAL', 'RexxInstResolveVariables'
  14. call RxFuncAdd 'RexxInstSetVariable', 'WPINSTAL', 'RexxInstSetVariable'
  15.  
  16.  
  17. continue = RexxInstResolveVariables( hFeature, "{Continue}", 1)
  18. path = RexxInstResolveVariables( hFeature, "{UserExitPath}", 1)
  19. say path
  20. if (where == PREREQ) then CALL PREREQ
  21.  
  22. /* check for font in install package */
  23. path = RexxInstResolveVariables( hFeature, "{UserExitPath}", 1)
  24. font = path"\package\tnrmt30.ttf"
  25. rc = stream( font, 'c', 'open read')
  26. empty = LINES( font )
  27. rc = stream( font, 'c', 'close' )
  28. if (empty == "0" ) then
  29.         DO
  30.         rc = RexxInstDeselect( hFeature, "" )
  31.         if continue <> "UNATTENDED" then
  32.         DO
  33.           keep = RexxInstResolveVariables( hFeature, "{Java11:MB_VAR}", 1)
  34.           zero = 0
  35.           rc = RexxInstSetVariable( hFeature,"Java11", "MB_VAR", zero );
  36.           new = RexxInstResolveVariables( hFeature, "{Java11:MB_VAR}", 1)
  37.           path'\message ' bootdrive hFeature message1
  38.           rc = RexxInstSetVariable( hFeature, "Java11", "MB_VAR", 4 );
  39.         END
  40.         EXIT
  41.         END
  42.  
  43.  
  44.  
  45. PREREQ:
  46.  
  47. /* check for FixPack 30 or higher    */
  48.  
  49. tmpfile = bootdrive'\j11servc.tmp'
  50. 'bldlevel 'bootdrive'\os2krnl >'  tmpfile
  51. line = LINEIN( tmpfile)
  52. ret = STREAM( tmpfile, 'c', 'close')
  53. '@erase' tmpfile
  54.  
  55. 'bldlevel 'bootdrive'\os2krnl >'  file
  56. line = LINEIN( file)
  57. say line
  58. PARSE VAR line temp '#@';
  59. temp = REVERSE( temp)
  60. PARSE VAR temp temp ':MBI';
  61. level = REVERSE( temp)
  62.  
  63. if (where == PREREQ) then CALL CHECKBASE
  64.  
  65. if level < 8.254
  66. then
  67. DO
  68. rc = RexxInstDeselect( hFeature, "" )
  69. if continue <> "UNATTENDED" then
  70. DO
  71.   keep = RexxInstResolveVariables( hFeature, "{MB_VAR}", 1)
  72.   rc = RexxInstSetVariable( hFeature, "Java11", "MB_VAR", 0 );
  73.   path'\message ' bootdrive hFeature message2
  74.   rc = RexxInstSetVariable( hFeature, "Java11", "MB_VAR", keep );
  75. END
  76. END
  77.  
  78. ret = STREAM( file, 'c', 'close')
  79. '@erase' file
  80. EXIT
  81.  
  82. CHECKBASE:
  83. if level < 9.23 then x = RexxInstSetVariable( hFeature, "Java11", "MERLIN", "NO")
  84. if level < 8.162
  85. then
  86. DO
  87. if level = 7.029 then CALL BYE
  88. if continue <> "UNATTENDED" then
  89. DO
  90.   rc = RexxInstSetVariable( hFeature, "Java11", "MB_VAR", 0 );
  91.   path'\message ' bootdrive hFeature message3
  92. END
  93. rc = RexxInstDeselect( hFeature, "Java11" )
  94. END
  95.  
  96.  
  97. BYE:
  98. ret = STREAM( file, 'c', 'close')
  99. '@erase' file
  100. EXIT
  101.  
  102.  
  103.