home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / CHIPinte022000.iso / office51 / os2 / misc / java / jre117 / JAVAINUF.EXE / en / syslvl.cmd < prev    next >
Encoding:
Text File  |  1998-10-13  |  5.9 KB  |  120 lines

  1. /* rexx */
  2.  
  3. parse UPPER arg fHandle bootdrive  PATH COMPONENT
  4.  
  5. /* translation strings: */
  6. message1R = "The Java Runtime on the system is newer than the version being installed.  Do you still wish to install the Java Runtime?"
  7. message2R = "You are about to install over an old Beta or Alpha level of Java Runtime.  Do you still wish to install the Java Runtime?"
  8. message1S = "The version of Samples on the system is newer than the version being installed.  Do you still wish to install the Samples component?"
  9. message2S = "You are about to install over an old Beta or Alpha level of Samples.  Do you still wish to install the Samples component?"
  10. message1T = "The version of the Toolkit (JDK) on the system is newer than the version being installed.  Do you still wish to install the Toolkit component?"
  11. message2T = "You are about to install over an old Beta or Alpha level of the Toolkit (JDK).  Do you still wish to install the Toolkit component?"
  12. message1D = "The version of ICATJAVA for OS/2 on the system is newer than the version being installed.  Do you still wish to install the ICATJAVA component?"
  13. message2D = "You are about to install over an old Beta or Alpha level of ICATJAVA for OS/2.  Do you still wish to install the ICATJAVA component?"
  14.  
  15. call RxFuncAdd 'RexxInstResolveVariables', 'WPINSTAL', 'RexxInstResolveVariables'
  16. call RxFuncAdd 'RexxInstSetVariable', 'WPINSTAL', 'RexxInstSetVariable'
  17. call RxFuncAdd 'RexxInstDeselect', 'WPINSTAL', 'RexxInstDeselect'
  18.  
  19. continue = RexxInstResolveVariables( fHandle, "{Continue}", 1)
  20. if continue = "UNATTENDED" then EXIT
  21.  
  22. if ReadSysLevel(PATH"\syslevel."COMPONENT) then do
  23.       if substr(st.achCsdLevel, 4, 4) = 9999 then CALL 9999;
  24.       else if substr(st.achCsdLevel, 4, 4)>> 4007 then CALL LOWER
  25.       exit /* current syslevel at equal or higher level */
  26.       end
  27. EXIT   /*  none found  */
  28.  
  29.  
  30. 9999:   /* ALPHA/BETA level exists:    */
  31.         path = RexxInstResolveVariables( fHandle, "{UserExitPath}", 1)
  32.          if (COMPONENT == "JAV") then
  33.              path'\..\message' bootdrive fHandle message2R
  34.          else
  35.          if (COMPONENT == "JSP") then
  36.              path'\..\message' bootdrive fHandle message2S
  37.          else
  38.          if (COMPONENT == "JTK") then
  39.              path'\..\message' bootdrive fHandle message2T
  40.          else
  41.          if (COMPONENT == "ICA") then
  42.              path'\..\message' bootdrive fHandle message2D
  43.         continue = RexxInstResolveVariables( fHandle, "{Continue}", 1)
  44.          if continue = "QUIT" then CALL STOP; else EXIT
  45.  
  46.  
  47. LOWER:   /* installing version lower than current version  */
  48.         path = RexxInstResolveVariables( fHandle, "{UserExitPath}", 1)
  49.          if (COMPONENT == "JAV") then
  50.              path'\..\message' bootdrive fHandle message1R
  51.          else
  52.          if (COMPONENT == "JSP") then
  53.              path'\..\message' bootdrive fHandle message1S
  54.          else
  55.          if (COMPONENT == "JTK") then
  56.              path'\..\message' bootdrive fHandle message1T
  57.          else
  58.          if (COMPONENT == "ICA") then
  59.              path'\..\message' bootdrive fHandle message1D
  60.         continue = RexxInstResolveVariables( fHandle, "{Continue}", 1)
  61.          if continue = "QUIT" then CALL STOP; else EXIT
  62.  
  63.  
  64.  
  65. STOP:
  66.          if (COMPONENT == "JAV") then
  67.          DO
  68.              rc = RexxInstDeselect( fHandle, Runtime);
  69.              keepJAVA11U = RexxInstResolveVariables( fHandle, "{Java11:TlktDocSelected}", 1)
  70.              if ( keepJAVA11U == "NO" )
  71.              then
  72.              rc = RexxInstDeselect( fHandle, Java11U );
  73.          END;
  74.          else
  75.          if (COMPONENT == "JSP") then
  76.              rc = RexxInstDeselect( fHandle, Samples);
  77.          else
  78.          if (COMPONENT == "JTK") then
  79.              rc = RexxInstDeselect( fHandle, Toolkit);
  80.          else
  81.          if (COMPONENT == "ICA") then
  82.              rc = RexxInstDeselect( fHandle, Debugger);
  83. EXIT
  84.  
  85.  
  86. ReadSysLevel: procedure expose slfh. st.
  87. call Trace OFF
  88. parse arg fs
  89.  
  90.    res = 0
  91.    if stream(fs,"C","Query Exists") <> "" then do
  92.       data = charin(fs,1,chars(fs))
  93.       slfh.usSignature   = c2x(reverse(substr(data,1,2)))     /* special # for id of syslevel file */
  94.       slfh.achSignature  = substr(data,3,8)                   /* string to id slf file, must be 'SYSLEVEL' */
  95.       slfh.achJulian     = substr(data,11,5)                  /* date of version */
  96.       slfh.usSlfVersion  = c2x(reverse(substr(data,16,2)))    /* version of syslevel file, must be 1 */
  97.       slfh.ausReserved   = c2x(substr(data,18,16))            /* reserved */
  98.       slfh.ulTableOffset = c2d(reverse(substr(data,34,4)))    /* offset of SYSTABLE */
  99.  
  100.       /* Calculate table start
  101.       */
  102.       tblst = slfh.ulTableOffset+1
  103.  
  104.       st.usSysId       = c2x(reverse(substr(data, tblst+0,2))) /* identifies system /subsytem */
  105.       st.bSysEdition   = c2x(substr(data, tblst+2,1))          /* edition of system, eg SE=00, EE=01 */
  106.       st.bSysVersion   = c2x(substr(data, tblst+3,1))          /* version, eg 1.00=10, 1.10=11 */
  107.       st.bSysModify    = c2x(substr(data, tblst+4,1))          /* modify, eg 1.00=00, 1.01=01 */
  108.       st.usSysDate     = c2x(reverse(substr(data, tblst+5,2))) /* date of system */
  109.       st.achCsdLevel   = substr(data, tblst+7,8)               /* subsytem CSD level, eg, XR?0000_ */
  110.       st.achCsdPrev    = substr(data, tblst+15,8)              /* as above, except for prev system */
  111.       st.achSysName    = substr(data, tblst+23,80)             /* Title of system / subsytem (ASCIIZ) */
  112.       st.achCompId     = substr(data, tblst+103,9)             /* component ID of subsytem */
  113.       st.bRefreshLevel = c2x(substr(data, tblst+112,1))
  114.       st.achType       = substr(data, tblst+113,9)             /* Null terminated type (8 chars +'\0') */
  115.       st.usReserved    = substr(data, tblst+122,12)            /* reserved, must be 0 */
  116.       res = 1
  117.       call stream fs,"C","Close"
  118.    end
  119. return res
  120.