home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 17 Fixes30
/
17-Fixes30.zip
/
xr_w040.kdk
/
FIXSYSL.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-06-11
|
4KB
|
109 lines
/**************************************/
/* Correct syslevel errors for Warp: */
/* S3 video Current CSD XR02110 */
/* Previous CSD XR03xxx */
/* Set Current=Prev */
/* APTIVA Current CSD XR03005 */
/* COMPID 562260100 */
/* TYPE WP */
/* Set Current CSD=XR03002 */
/* */
/* 6/11/97 - use different method to */
/* find boot drive */
/**************************************/
Arg file . /* File to process */
If file='' then
Do
Say 'You must specify the fully qualified path of the SYSLEVEL file you'
Say 'want corrected.'
Say
Say 'Example: fixsysl c:\os2\install\syslevel.os2'
Signal Done
End
/*******************/
/* Find boot drive */
/*******************/
env='OS2ENVIRONMENT' /* Environment name */
Parse Upper Value Value('PATH',,env) With '\OS2\SYSTEM' -2 boot +2
If boot='' | length(boot)<>2 | right(boot,1)<>':' then
Do
Say 'Unable to locate your boot drive based on the location of \OS2\SYSTEM'
Say 'in your PATH statement in CONFIG.SYS.'
Signal Done
End
/***********************************/
/* Register all REXXUTIL functions */
/***********************************/
rc=RxFuncAdd('SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs')
Call SysLoadFuncs
path=FileSpec('DRIVE',file)||FileSpec('PATH',file)
Parse value FileSpec('NAME',file) with .'.'ext .
tempfile=SysTempFileName(path||'SYSLEV??.'||ext)
Call SysFileTree file,'files','B'
Parse value files.1 with . . . atts .
ro=pos('R',atts)>0 /* 1=R/O attribute set */
If ro then
Do
chk=boot||'\OS2\ATTRIB.EXE'
If stream(chk,'C','Query Exists')='' then
Do
Say 'ATTRIB command not available, cannot reset R/O attribute of' file
Signal Done
End
End
size=stream(file,'C','Query Size')
call stream file,'C','Open Read'
data=charin(file,1,size)
call stream file,'C','Close'
curcsd =substr(data,45,7) /* Current CSD level */
prevcsd=substr(data,53,7) /* Previous CSD level */
compid=substr(data,141,9) /* Component ID */
type=strip(substr(data,151,8),'B','00'x) /* Type */
update=0
/*****************************************/
/* S3 driver install messed up SYSLEVEL? */
/*****************************************/
If curcsd='XR02110' & substr(prevcsd,1,4)='XR03' then
Do
Say 'Changing Current CSD level from 'curcsd' to 'prevcsd
data=overlay(prevcsd,data,45)
update=1
End
Else
/****************************/
/* APTIVA Preload incorrect */
/****************************/
If curcsd='XR03005' & compid='562260100' & type='WP' then
Do
Say 'Changing Current CSD level from 'curcsd' to XR03002'
data=overlay('XR03002',data,45)
update=1
End
If update then
Do
'@COPY' file tempfile '>NUL' /* Backup existing file */
Say 'Saved 'file' as 'tempfile
If ro then /* Reset R/O attrib if need */
'@ATTRIB -R 'file '>NUL'
Call SysFileDelete(file) /* Delete existing */
Say 'Deleted 'file
call stream file,'C','Open Write'
Call charout file,data /* Create new */
call stream file,'C','Close'
If ro then /* Set R/O attrib if previously set */
'@ATTRIB +R 'file '>NUL'
Say 'Created 'file
End
Else
Say file 'is not corrupted.'
Done:
Exit