home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1998 October
/
VPR9810B.BIN
/
IBM_OS
/
JDK116
/
JAVAINTK.ZIP
/
precheck.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-05-18
|
9KB
|
214 lines
/* rexx */
/* Load external FI API
*/
call RxFuncAdd 'RexxInstSetVariable', 'WPINSTAL', 'RexxInstSetVariable'
call RxFuncAdd 'RexxInstResolveVariables', 'WPINSTAL', 'RexxInstResolveVariables'
call RxFuncAdd 'RexxInstDeselect', 'WPINSTAL', 'RexxInstDeselect'
call RxFuncAdd 'RexxInstSelect', 'WPINSTAL', 'RexxInstSelect'
/* Get the objectid (feature handle), and the current package from the arguments
*/
parse arg objectid package
/* Determine if we will check the runtime checkbox and feature
*/
RTChecked = 0
/* Check for a syslevel file and the correct version
*/
if ReadSysLevel(package"\syslevel.jav") then do
if st.bSysVersion = 11 & st.bSysModify = 6 then do
call RexxInstSetVariable objectid,"Runtime" ,"CheckableRT","1"
call RexxInstSelect objectid,"Runtime"
call RexxInstSelect objectid,"RuntimeConfig"
call RexxInstSelect objectid,"Unicode"
call RexxInstSelect objectid,"UnicodeConfig"
call RexxInstSetVariable objectid,"Runtime.Visible" ,"CheckableRT","1"
call RexxInstSelect objectid,"Runtime.Visible"
RTChecked = 1
end
else do
call RexxInstSetVariable objectid,"Runtime" ,"CheckableRT","0"
call RexxInstDeSelect objectid,"Runtime"
call RexxInstDeSelect objectid,"RuntimeConfig"
call RexxInstDeSelect objectid,"Unicode"
call RexxInstDeSelect objectid,"UnicodeConfig"
call RexxInstSetVariable objectid,"Runtime.Visible" ,"CheckableRT","0"
call RexxInstDeSelect objectid,"Runtime.Visible"
end
end
else do
call RexxInstSetVariable objectid,"Runtime" ,"CheckableRT","0"
call RexxInstDeSelect objectid,"Runtime"
call RexxInstDeSelect objectid,"RuntimeConfig"
call RexxInstDeSelect objectid,"Unicode"
call RexxInstDeSelect objectid,"UnicodeConfig"
call RexxInstSetVariable objectid,"Runtime.Visible" ,"CheckableRT","0"
call RexxInstDeSelect objectid,"Runtime.Visible"
end
/* See if the user already has the correct Runtime installed
*/
RTInstalled = 0
InstalledVersion = RexxInstResolveVariables(objectid, "{INV_Runtime:VersionNumber}", 0)
CurrentVersion = RexxInstResolveVariables(objectid, "{Runtime:VersionNumber}", 0)
if InstalledVersion = CurrentVersion then do
RTInstalled = 1
end
/* Set variable for response file dependency checking
*/
call RexxInstSetVariable objectid,"Java11" ,"RTInstalled", RTInstalled
/* Determine if we will check the toolkit, samples and debugger checkboxs and features
*/
/* Check for a syslevel file and the correct version
*/
if ReadSysLevel(package"\syslevel.jtk") then do
if (st.bSysVersion = 11) & (st.bSysModify = 6) & (RTChecked | RTInstalled) then do
call RexxInstSetVariable objectid,"Toolkit" ,"CheckableTK","1"
call RexxInstSelect objectid,"Toolkit"
call RexxInstSelect objectid,"ToolkitConfig"
call RexxInstSetVariable objectid,"Samples" ,"CheckableSM","1"
call RexxInstSelect objectid,"Samples"
call RexxInstSelect objectid,"SamplesConfig"
call RexxInstSetVariable objectid,"Debugger","CheckableIC","1"
call RexxInstSelect objectid,"Debugger"
call RexxInstSelect objectid,"DebuggerConfig"
end
else do
call RexxInstSetVariable objectid,"Toolkit" ,"CheckableTK","0"
call RexxInstDeselect objectid,"Toolkit"
call RexxInstDeselect objectid,"ToolkitConfig"
call RexxInstSetVariable objectid,"Samples" ,"CheckableSM","0"
call RexxInstDeselect objectid,"Samples"
call RexxInstDeselect objectid,"SamplesConfig"
call RexxInstSetVariable objectid,"Debugger","CheckableIC","0"
call RexxInstDeselect objectid,"Debugger"
call RexxInstDeselect objectid,"DebuggerConfig"
end
end
else do
call RexxInstSetVariable objectid,"Toolkit" ,"CheckableTK","0"
call RexxInstDeselect objectid,"Toolkit"
call RexxInstDeselect objectid,"ToolkitConfig"
call RexxInstSetVariable objectid,"Samples" ,"CheckableSM","0"
call RexxInstDeselect objectid,"Samples"
call RexxInstDeselect objectid,"SamplesConfig"
call RexxInstSetVariable objectid,"Debugger","CheckableIC","0"
call RexxInstDeselect objectid,"Debugger"
call RexxInstDeselect objectid,"DebuggerConfig"
end
/* Determine if we will check the toolkit documentation checkbox and feature
*/
/* Check for a syslevel file and the correct version
*/
if ReadSysLevel(package"\syslevel.jtk") then do
if st.bSysVersion = 11 & st.bSysModify = 6 then do
call RexxInstSetVariable objectid,"TlktDoc" ,"CheckableTD","1"
call RexxInstSelect objectid,"TlktDoc"
call RexxInstSelect objectid,"TlktDocConfig"
end
else do
call RexxInstSetVariable objectid,"TlktDoc" ,"CheckableTD","0"
call RexxInstDeselect objectid,"TlktDoc"
call RexxInstDeselect objectid,"TlktDocConfig"
end
end
else do
call RexxInstSetVariable objectid,"TlktDoc" ,"CheckableTD","0"
call RexxInstDeselect objectid,"TlktDoc"
call RexxInstDeselect objectid,"TlktDocConfig"
end
/* Determine if we will check the Unicode Font checkbox and feature
*/
/* Check for a syslevel file and the correct version
*/
if ReadSysLevel(package"\syslevel.juf") then do
if (st.bSysVersion = 10) & (st.bSysModify = 0) then do
call RexxInstSetVariable objectid,"UniFont" ,"CheckableUF","1"
call RexxInstSelect objectid,"UniFont"
call RexxInstSelect objectid,"UniFontConfig"
call RexxInstSelect objectid,"TTEngine"
call RexxInstSelect objectid,"TTEngineConfig"
end
else do
call RexxInstSetVariable objectid,"UniFont" ,"CheckableUF","0"
call RexxInstDeselect objectid,"UniFont"
call RexxInstDeselect objectid,"UniFontConfig"
call RexxInstSelect objectid,"TTEngine"
call RexxInstDeselect objectid,"TTEngineConfig"
end
end
else do
call RexxInstSetVariable objectid,"UniFont" ,"CheckableUF","0"
call RexxInstDeselect objectid,"UniFont"
call RexxInstDeselect objectid,"UniFontConfig"
call RexxInstSelect objectid,"TTEngine"
call RexxInstDeselect objectid,"TTEngineConfig"
end
return 0
/* Subroutine: ReadSysLevel
* Input: fs - filespec of a syslevel file
* Output: 0 = File not readable
* 1 = File readable
*
* Side Effects: Structures st and slfh created:
* st = Syslevel Table ( see comments below )
* slfh = Sysleve File Header ( see comments below )
*
*
*
*
*/
ReadSysLevel: procedure expose slfh. st.
call Trace OFF
parse arg fs
res = 0
if stream(fs,"C","Query Exists") <> "" then do
data = charin(fs,1,chars(fs))
slfh.usSignature = c2x(reverse(substr(data,1,2))) /* special # for id of syslevel file */
slfh.achSignature = substr(data,3,8) /* string to id slf file, must be 'SYSLEVEL' */
slfh.achJulian = substr(data,11,5) /* date of version */
slfh.usSlfVersion = c2x(reverse(substr(data,16,2))) /* version of syslevel file, must be 1 */
slfh.ausReserved = c2x(substr(data,18,16)) /* reserved */
slfh.ulTableOffset = c2d(reverse(substr(data,34,4))) /* offset of SYSTABLE */
/* Calculate table start
*/
tblst = slfh.ulTableOffset+1
st.usSysId = c2x(reverse(substr(data, tblst+0,2))) /* identifies system /subsytem */
st.bSysEdition = c2x(substr(data, tblst+2,1)) /* edition of system, eg SE=00, EE=01 */
st.bSysVersion = c2x(substr(data, tblst+3,1)) /* version, eg 1.00=10, 1.10=11 */
st.bSysModify = c2x(substr(data, tblst+4,1)) /* modify, eg 1.00=00, 1.01=01 */
st.usSysDate = c2x(reverse(substr(data, tblst+5,2))) /* date of system */
st.achCsdLevel = substr(data, tblst+7,8) /* subsytem CSD level, eg, XR?0000_ */
st.achCsdPrev = substr(data, tblst+15,8) /* as above, except for prev system */
st.achSysName = substr(data, tblst+23,80) /* Title of system / subsytem (ASCIIZ) */
st.achCompId = substr(data, tblst+103,9) /* component ID of subsytem */
st.bRefreshLevel = c2x(substr(data, tblst+112,1))
st.achType = substr(data, tblst+113,9) /* Null terminated type (8 chars +'\0') */
st.usReserved = substr(data, tblst+122,12) /* reserved, must be 0 */
res = 1
call stream fs,"C","Close"
end
return res