home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 30 fixes_v
/
30-fixes_v.zip
/
r212sp.zip
/
FIXSNL.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-06
|
5KB
|
202 lines
/* FIXSNL - Fix SNA-Link */
/* Part of the RemoteControl/2 1.2.02 CSD */
/* Copyright 1995 - Compuware Corporation */
/* Required files: SNLFIX.ZIP */
/* Save the calling environment */
nRC = setlocal()
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
call SysCls
say''
say 'RemoteControl/2 FIX SNA-Link program.'
say ''
say 'This installation requires that all RemoteControl/2 components be shutdown.'
say 'However, this fix can still be applied if CSINIT has been executed.'
say ''
say 'Press <enter> to continue or "Q" to Quit...'
say ''
pull rsp
If rsp = 'Q' Then call fReturnOS2 '1'
call fInitialize
call fGetInstallationDir
call fCheckSNALink
say ' '
If SNALinkFound = 'Y' Then Do
say 'SNA-Link found on this directory. Replacing (8) files...'
say ''
'@PKUNZIP2 -o ' szSourceDriveDir || '\SNLFIX.ZIP' szTargetDriveDir
End
Else Do
say 'SNA-Link not found on this directory.'
say 'Press <enter> to exit.'
pull .
call fReturnOS2 '1'
End
say ' '
if rc = 0 then do
say 'The fix has been applied successfully.'
say 'You may begin using RemoteControl/2 immediately.'
end
else do
say 'Error copying files.'
say ''
say 'Please make sure that the following RemoteControl/2 components are not running:'
say ''
say 'Administrator, Remote Services, Local Directory Services,'
say 'Master Directory Services, and SNA-Link'
say ''
end
call fReturnOS2 '0'
EXIT
/* --------------------------------------------- */
/* Setup Variable */
/* ----------------------------------------------*/
fInitialize:
SNALinkFound = 'N'
NO = 0
YES = 1
szSourceDrive = ' '
szSourceDir = ' '
szSourceDriveDir = ' '
szTargetDrive = 'C:'
szTargetDir = '\REMCON2'
szTargetDriveDir = 'C:\REMCON2'
szAnswer = ''
szTemp1 = ''
szLocalDrives = ''
szWorkDrives = ''
nRC = 0
nReturnCode = 0
nStrLength = 0
nRow = 0
nCol = 0
/* No source drive and dir was passed as a parameter */
/* get the base drive from which install was started */
call fGetStartDrive
szSourceDrive = RESULT
/* get the base directory from which install was started */
call fGetStartDir
szSourceDir = RESULT
if szSourceDir = '\'
then szSourceDir = ''
szSourceDriveDir = szSourceDrive || szSourceDir
return
/* Ask for a directory to install the software in */
/*---------------------------------------------------------------------*/
fGetInstallationDir:
szTargetDriveDir = ''
do while length(szTargetDriveDir) = 0
call SysCls
say ''
say 'Enter the drive and directory in which RemoteControl/2 has been installed'
say 'or press <enter> for the default: C:\REMCON2'
say''
pull szAnswer
if szAnswer = '' then
szAnswer = 'C:\REMCON2'
if substr(szAnswer, 2, 1) = ':' then do
szTargetDrive = substr(szAnswer, 1, 1) || ':'
nStrLength = length(szAnswer)
szTargetDir = substr(szAnswer, 3)
szTargetDriveDir = szTargetDrive || szTargetDir
call SysFileTree szTargetDriveDir||'\CWNETB2.DLL', szFiles,'F'
if szFiles.0 = 0 then do
say ''
say 'RemoteControl/2 files not found in 'szTargetDriveDir
say ''
say 'Press <enter> to Retry or "Q" to Quit...'
say ''
pull szAnswer2
If szAnswer2 = 'Q' Then
call fReturnOS2 '1'
Else
call fGetInstallationDir
end /* if szFiles.0=0 */
end /* if */
end /* do */
return
/*---------------------------------------------------------------------*/
/* Determine whether SNA-Link is installed */
/*---------------------------------------------------------------------*/
fCheckSNALink:
call SysFileTree szTargetDriveDir||'\SNALINK.EXE', szFiles,'SFO'
if szFiles.0 = 1 then
SNALinkFound = 'Y'
return
/*------------------------------------------------------------------------*/
fGetStartDrive:
Procedure
parse source IsCmd IsOS2 MyCmdLine
MyDrive = substr(MyCmdLine, 1, 2)
return MyDrive
/*------------------------------------------------------------------------*/
/* Return the starting drive subdirectory. IE A:\MYLIB\STARTIT\SETUP.CMD */
/* will result in a RETURN of \MYLIB\STARTIT */
/*------------------------------------------------------------------------*/
fGetStartDir:
Procedure
parse source IsCmd IsOS2 MyCmdLine
szWork = filespec('PATH', MyCmdLine)
szStrLength = length(szWork)
if szStrLength < 2
then return '\'
else return substr(szWork, 1, szStrLength - 1)
/* Exit REXX program */
fReturnOS2:
Procedure
Arg nReturnCode
nRC = endlocal()
EXIT nReturnCode