home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MGA Millennium Bulk
/
BLK_5_FEB_96.iso
/
os2
/
uninstal.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-06-14
|
5KB
|
150 lines
/********************************************************************/
/********************************************************************/
'@echo off'
say ''
'echo USE: "uninstal clean" to remove all MGA drivers from hard disk"'
say ''
'echo press Ctrl+C to abort'
'pause'
CurDir=directory()
/********************************************************************/
/* Seach for OS2 system path in PATH environement */
/********************************************************************/
env = 'OS2ENVIRONMENT'
Path = value('PATH',,env)
if Path = '' then signal ENDSEARCH
ntmp = pos(':\OS2;', Path)
if ntmp = 0 then signal ENDSEARCH
Dstdrv=substr(Path, ntmp-1,2)
/*********************************************************************/
/* remove any MGA statement from CONFIG.SYS */
/*********************************************************************/
NewDir=directory(Dstdrv'\') /* go to root off OS/2 drive */
InnF=Dstdrv'\CONFIG.MGA'
OutF=Dstdrv'\CONFIG.SYS'
'copy 'OutF' 'InnF' >nul'
'del 'OutF
do until lines(InnF) = 0
InStr = linein(InnF)
select
when pos('MGAKRNL.SYS', InStr) > 0 then nop /* Terminator */
when pos('MGA=', InStr) > 0 then nop /* Termin / Millen */
when pos('MGARES=', InStr) > 0 then nop /* Terminator < 2.0 */
when pos('VIO_MGA', InStr) > 0 then nop /* Termin / Millen */
when pos('RAMBIOS.SYS', InStr) > 0 then nop /* Terminator < 2.0 */
when pos('VMGA.SYS', InStr) > 0 then nop /* Terminator */
when pos('KMGAX64.SYS', InStr) > 0 then nop /* Millennium */
when pos('VMGAX64.SYS', InStr) > 0 then nop /* Millennium */
otherwise
do
if pos('LIBPATH=', InStr) > 0 then do
itmp = pos(':\MGA\OS', InStr)
if itmp > 0 then stmp=delstr(InStr, itmp-1, 11)
else stmp=InStr
call lineout OutF, stmp
end
else do
itmp = pos(':\MGA\OS2', InStr)
if itmp = 0 then call lineout OutF, InStr
end
end
end
end
call stream OutF, 'c', 'close'
call stream InnF, 'c', 'close'
'del 'InnF
/**********************************/
/* remove MGAs from AUTOEXEC.BAT */
/**********************************/
'call 'Dstdrv'\MGA\OS2\FIXAUTO.CMD 'Dstdrv' OFF'
call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
call sysloadfuncs
ver = SysOS2Ver()
/********************************************************************/
/* Get arguments if any */
/********************************************************************/
Parse Arg all
If words(all) = 1 then OPTION = translate(word(all,1))
if OPTION \= 'CLEAN' then signal Finished
/********************************************************************/
/* Seach for WinOS2 path in OS2.INI */
/********************************************************************/
Windrv=Dstdrv /* default value */
WinDir=Windrv'\OS2\MDOS\WINOS2' /* default value */
FoundWindir=0 /* not found yet */
IniFile='USER'
Apps='PM_INSTALL'
AppsKeys='WINOS2_LOCATION'
call SysIni IniFile, Apps, AppsKeys
if Result \= 'ERROR:' then
do
val = SysIni(IniFile, Apps, AppsKeys)
NewDir=directory(val)
if NewDir\= '' then do
WinDir=NewDir
Windrv=Left(WinDir,2)
FoundWindir=1 /* found it */
end
end
NewDir=directory(Dstdrv'\MGA\OS2')
'if exist syslevel.mga del syslevel.mil'
'if exist uninstal.cmd del uninstal.cmd'
'if exist mgaconf.cmd del mgaconf.cmd'
'if exist fixauto.cmd del fixauto.cmd'
'if exist mgax64s.dsp del mgax64s.dsp'
'if exist rambios.sys del rambios.sys'
'if exist KMGAX64.SYS del KMGAX64.SYS'
NewDir=directory(Dstdrv'\OS2\DLL')
'if exist pmgax64.dll del pmgax64.dll'
'if exist bmgax64.dll del bmgax64.dll'
NewDir=directory(Dstdrv'\OS2\MDOS')
'if exist vmga.sys del VMGAX64.SYS'
if FoundWindir=0 then signal Finished
NewDir=directory(WinDir'\SYSTEM')
'if exist smgax64.drv del smgax64.drv'
'if exist mgax64.dll del mgax64.dll'
NewDir=directory(Dstdrv'\OS2\MDOS\WINJOS2\SYSTEM')
'if exist smgax64.drv del smgax64.drv'
'if exist mgax64.dll del mgax64.dll'
Finished:
call directory CurDir
say ''
say 'FINISH'
say ''
say 'RUN DSPINSTL ?'
'echo press Ctrl+C to abort'
'pause'
NewDir=directory(Dstdrv'\OS2\INSTALL') /* go to root off OS/2 drive */
'DSPINSTL.EXE' /* install other display driver */
call directory CurDir
exit
ENDSEARCH:
say 'Can not locate OS/2 System drive'