home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
vlmkt6.exe
/
WS_LWP_D.CPF
< prev
next >
Wrap
Text File
|
1993-09-28
|
9KB
|
325 lines
/*
** Copyright (c) 1992 Novell, Inc. All Rights Reserved.
**
** THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS
** AND TREATIES. NO PART OF THIS WORK MAY BE USED, PRACTICED,
** PERFORMED COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED,
** ABRIDGED, CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED,
** RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT
** OF NOVELL, INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT
** AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO CRIMINAL AND CIVIL
** LIABILITY.
*/
syntax (1.1);
component (
/* CompID */ WS_LWP_D,
/* CompVer */ 4.1,
/* CompStatus */ Retail
);
string targetName[39];
string sourceDirectory;
string targetDirectory;
int i; /* Loop control variable */
string userName; /* For R-Utilities */
string tempPath; /* Path to temporary files */
int fh; /* File handle for fopen, etc. */
int fho; /* Output file handle for fopen, etc. */
int fc; /* Return code from fgets when rc is busy */
string inputLine; /* Line read from file */
string scanLine; /* 'inputLine' set to upper case */
int rc; /* Return code from various functions */
int rc1; /* String search results */
int rc2; /* String search results */
int count; /* Number of drivers loaded in CONFIG.SYS */
string driverList; /* List if drivers loaded in CONFIG.SYS */
int ansiFound; /* Found ANSI driver in CONFIG.SYS */
string ansiPath; /* Path to ANSI.SYS */
string ch;
int lineNumber;
int pushed;
int LWP401;
int telapi;
string telapiLine;
/*
=====================================
= Now edit the AUTOEXEC.BAT file. =
=====================================
*/
userName = "";
if (bootType != BOOT_BY_RPL) {
tempPath = GetTempDir();
AppendPath (tempPath, "INSTALL.TMP");
if (silentcopy (pathAUTOEXEC_BAT, tempPath)) {
DisplayErrorCondition (FATAL);
} /* end if */
fh = fopen (tempPath, "r");
fho = fopen (pathAUTOEXEC_BAT, "w");
fc = fgets (inputLine, fh);
lineNumber = 1;
pushed = 0;
LWP401 = 0;
telapi = 0;
while (fc) {
scanLine = inputLine;
strupr (scanLine);
rc = 0;
do { /* Skip leading whitespace */
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t"));
scanLine = substr (scanLine, rc, 255);
if (1 == searchstr (scanLine, ":TCPIP")) {
/*
======================================================
= This section determines that whether the 4.01 =
= installation is a LWP or OEM TCPIP by checking =
= if "SET NAME=" presents within ":TCPIP" and =
= ":NOTCPIP" =
======================================================
*/
fc = fgets (inputLine, fh);
rc = 0;
while (fc && !rc) {
scanLine = inputLine;
strupr (scanLine);
rc = searchstr (scanLine, ":NOTCPIP");
if (!rc) {
if (1 == searchstr (scanLine, "SET")) {
rc1 = 3; /* Skip the "set" keyword */
do {
rc1 = rc1 + 1;
ch = substr (scanLine, rc1, 1);
} while ((ch == " ") || (ch == "\t"));
scanLine = substr (scanLine, rc1, 255);
if (1 == searchstr (scanLine, "NAME")) {
rc1 = 4; /* Skip the "name" keyword */
do {
rc1 = rc1 + 1;
ch = substr (scanLine, rc1, 1);
} while ((ch == " ") || (ch == "\t"));
ch = substr (scanLine, rc1, 1);
if (ch == "=") LWP401 = 1;
}
} else if (searchstr (scanLine, "TELAPI")) {
telapiLine = inputLine;
telapi = 1;
}
fc = fgets (inputLine, fh);
} /* end if */
} /* end while */
} /* end if */
fc = fgets (inputLine, fh);
if (!(lineNumber % 5)) {
if (pushed) {
PopInformationText();
pushed = 0;
} else {
PushInformationText (2, STILL_EDITING);
pushed = 1;
} /* end if */
} /* end if */
lineNumber = lineNumber + 1;
} /* end while */
if (pushed) PopInformationText();
rc = fclose (fh);
fh = fopen (tempPath, "r"); /* reopen input file */
fc = fgets (inputLine, fh);
lineNumber = 1;
pushed = 0;
while (fc) {
scanLine = inputLine;
strupr (scanLine);
rc = 0;
do { /* Skip leading whitespace */
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t"));
scanLine = substr (scanLine, rc, 255);
if (1 == searchstr (scanLine, "SET")) {
/*
======================================================
= Looks for "set path". If "set path" is found, =
= the leading "set" is deleted and control passes =
= to the PATH section below. =
======================================================
*/
rc = 3; /* Skip the "set" keyword */
do {
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t"));
scanLine = substr (scanLine, rc, 255);
if (1 == searchstr (scanLine, "PATH")) {
inputLine = substr (inputLine, rc, 255);
} /* end if */
} /* end if */
if ((1 == searchstr (scanLine, "PATH")) && (!LWP401)) {
/*
======================================================
= This section edits the path statement to remove =
= the "\xln\bin40" component of the path. =
======================================================
*/
ch = substr (scanLine, 5, 1);
if ((ch == "=") || (ch == " ") || (ch == "\t")) {
rc = searchstr (scanLine, ":\\XLN\\BIN40");
if (rc) {
scanLine =
substr (scanLine, 1, rc - 2) +
substr (scanLine, rc + 12, 99);
inputLine =
substr (inputLine, 1, rc - 2) +
substr (inputLine, rc + 12, 99);
} /* end if */
} /* end if */
} /* end if */
if (1 == searchstr (scanLine, ":TCPIP")) {
/*
======================================================
= Comment out the invokation of TCPIP and Telapi =
= in 4.01 configuration =
======================================================
*/
rc = fputs (inputLine, fho);
fc = fgets (inputLine, fh);
rc = 0;
while (fc && !rc) {
scanLine = inputLine;
strupr (scanLine);
rc = searchstr (scanLine, ":NOTCPIP");
if (!rc) {
if (1 == searchstr (scanLine, "REM")) {
fputs (inputLine, fho);
} else if ((searchstr (scanLine, "TCPIP") &&
!searchstr (scanLine, "NOTCPIP")) ||
searchstr (scanLine, "TELAPI")) {
fputs ("REM " + inputLine, fho);
} else {
fputs (inputLine, fho);
} /* end if */
fc = fgets (inputLine, fh);
} /* end if */
} /* end while */
} /* end if */
/*
==============================================================
= If the line wasn't matched by any of the tests above, it =
= will just be passed to the output file. This has the =
= effect of passing all REMed statements without any =
= special test for them. =
==============================================================
*/
rc = fputs (inputLine, fho);
fc = fgets (inputLine, fh);
if (!(lineNumber % 5)) {
if (pushed) {
PopInformationText();
pushed = 0;
} else {
PushInformationText (2, STILL_EDITING);
pushed = 1;
} /* end if */
} /* end if */
lineNumber = lineNumber + 1;
} /* end while */
if (pushed) PopInformationText();
fputs ("CALL " + bootDrive + "\\lanwp.bat", fho);
rc = fclose (fh);
rc = fclose (fho);
} /* end if */
/*
=======================================================
= Now update the LANWP.BAT file to load tcpip, etc. =
=======================================================
*/
fh = fopen (GetTempDir() + "\\lanwp.bat", "a");
/*
=============================
= Invokation of TCPIP.EXE =
=============================
*/
if (bootType == BOOT_BY_RPL) {
tempPath = "PATH " + targetPath + "\\BIN;%path%";
rc = fputs (tempPath, fh);
rc = fputs ("tcpip.exe -c=" + bootDrive + "\\net.cfg", fh);
} else {
rc = fputs ("tcpip.exe", fh);
} /* end if */
/*
==========================================================
= Preserve the invokation of TELAPI for LWP 4.01 =
==========================================================
*/
if (telapi) rc = fputs(telapiLine, fh);
rc = fputs ("break on", fh);
rc = fputs (":noload", fh);
rc = fclose (fh);
if (bootType != BOOT_BY_RPL) {
if (LWP41 && IsFile (oldLANWP_BAT) && !sameLWP41dir) {
i = 0;
do {
rc = PutProfileString ("Protocol TCPIP", /* appName */
pathKeyName[i], /* keyName */
pathKeyValue[i]+";"+oldpathKeyValue[i],
/* valueString */
pathNET_CFG, /* fileName */
"CFG"); /* file type */
i = i + 1;
} while (i <= 3);
tempPath = GetTempDir();
AppendPath (tempPath, "INSTALL.TMP");
if (silentcopy (GetTempDir()+"\\lanwp.bat", tempPath)) {
DisplayErrorCondition (FATAL);
} /* end if */
fh = fopen (tempPath, "r");
fho = fopen (GetTempDir() + "\\lanwp.bat", "w");
fc = fgets (inputLine, fh);
while (fc) {
scanLine = inputLine;
strupr (scanLine);
if (1 == searchstr (scanLine, "PATH")) {
tempPath = "PATH " + targetPath + "\\BIN;" + oldLWP41path;
fputs (tempPath, fho);
} else {
fputs (inputLine, fho);
}
fc = fgets (inputLine, fh);
}
fclose (fh);
fclose (fho);
}
}