home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
vlmkt6.exe
/
WS_ODI.CPF
< prev
next >
Wrap
Text File
|
1993-09-28
|
13KB
|
431 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_ODI,
/* CompVer */ 4.1,
/* CompStatus */ Retail
);
string srcPath; /* Path to ODI directory */
string targetName[57]; /* Names of the files */
string sourceName[2];
string sourceDirectory;
string targetDirectory;
int i;
int srcVersion; /* Version of source file */
int dstVersion; /* Version of destination file */
string command;
string drive; /* splitpath() results */
string directory; /* splitpath() results */
string fname; /* splitpath() results */
string ext; /* splitpath() results */
int fh; /* File handle for fopen, etc. */
int fho; /* File handle for fopen, etc. */
int rc; /* Return code from various functions */
int fc;
string tempPath;
int limit;
string inputLine;
string scanLine;
static string MLIDname;
string INSname;
string pathMLID;
string pathINS;
string ch;
int found;
int lineNumber;
int pushed;
int installSLIP;
string sourcePath;
string null;
string frameValues;
string frame;
int foundSET;
int foundPATH;
string searchPath;
static int LWP41;
static int sameLWP41dir;
static string oldLWP41path;
static string oldLANWP_BAT;
string frameType;
string protocolIPX;
string protocolID;
srcPath = GetSourcePath();
AppendPath (srcPath, "NET\\ODI");
/*
=====================================================
= MLID used (MLIDbasename obtained in ws_conf.cpf =
=====================================================
*/
MLIDname = MLIDbasename + ".com";
INSname = MLIDbasename + ".ins";
/*
=======================================================================
= Find out what Frame type IPX uses and put it in the NET.CFG file. =
=======================================================================
*/
if (MLIDbasename == "NONE") {
rc = 1;
} else {
rc = GetProtocolIPX (MLIDbasename, protocolID, frameType);
} /* end if */
if (rc) {
protocolIPX = "Protocol IPX " + protocolID + " " + frameType;
} else {
tempPath = srcPath + "\\frames.ins";
rc = SelectParameterValue (tempPath, /* INS file */
"Frame", /* Parameter */
frameType, /* rtn value */
0, /* multiple */
NETWARE_FRAME_TYPE_INFO, /* instructions */
NETWARE_FRAME_TYPE_HELP, /* help */
NETWARE_FRAME_TYPE_INFO); /* info */
scanLine = frameType;
strupr (scanLine);
if (searchstr (scanLine, "ETHERNET_802.3")) {
protocolIPX = "Protocol IPX 0 " + frameType;
} else if (searchstr (scanLine, "ETHERNET_802.2")) {
protocolIPX = "Protocol IPX E0 " + frameType;
} else if (searchstr (scanLine, "ETHERNET_II")) {
protocolIPX = "Protocol IPX 8137 " + frameType;
} else if (searchstr (scanLine, "ETHERNET_SNAP")) {
protocolIPX = "Protocol IPX 8137 " + frameType;
} else if (searchstr (scanLine, "TOKEN-RING")) {
protocolIPX = "Protocol IPX E0 " + frameType;
} else if (searchstr (scanLine, "TOKEN-RING_SNAP")) {
protocolIPX = "Protocol IPX 8137 " + frameType;
} else if (searchstr (scanLine, "IBM_PCN2_802.2")) {
protocolIPX = "Protocol IPX E0 " + frameType;
} else if (searchstr (scanLine, "IBM_PCN2_SNAP")) {
protocolIPX = "Protocol IPX 8137 " + frameType;
} else if (searchstr (scanLine, "FDDI_802.2")) {
protocolIPX = "Protocol IPX E0 " + frameType;
} else if (searchstr (scanLine, "FDDI_SNAP")) {
protocolIPX = "Protocol IPX 8137 " + frameType;
} else if (searchstr (scanLine, "NOVELL_RX-NET")) {
protocolIPX = "Protocol IPX FA " + frameType;
} else {
protocolIPX = "";
} /* end if */
} /* end if */
if (MLIDbasename != "NONE") {
if (frameType != "") {
PutProfileString ("Link Driver " + MLIDbasename,/* Application Name */
"Frame " + frameType, /* Key Name */
" ", /* New Key Value */
pathNET_CFG, /* File Name */
"CFG"); /* File Type */
}
if (protocolIPX != "") {
PutProfileString ("Link Driver " + MLIDbasename,/* App Name */
protocolIPX, /* Key Name */
" ", /* New Value */
pathNET_CFG, /* File Name */
"CFG"); /* File Type */
} /* end if */
} /* end if */
/*
==============================================
= Configure NET.CFG for the MLID(s) useed. =
==============================================
*/
found = 0;
pathINS = srcPath + "\\" + INSname;
if (IsFile (pathINS)) found = 1;
frame = "Ethernet_II";
if (found) {
rc = CollectParameterValues (pathINS, /* Path to .INS file */
"Frame", /* Param requested */
frameValues); /* Return values */
i = 0;
while (i < rc) {
strupr (frameValues[i]);
if (searchstr (frameValues[i], "TOKEN-RING_SNAP" )) {
frame = "Token-Ring_SNAP";
} else if (searchstr (frameValues[i], "NOVELL_RX-NET" )) {
frame = "NOVELL_RX-NET";
} else if (searchstr (frameValues[i], "IBM_PCN2_SNAP" )) {
frame = "IBM_PCN2_SNAP";
} else if (searchstr (frameValues[i], "FDDI_SNAP" )) {
frame = "FDDI_SNAP";
} /* end if */
i = i + 1;
} /* end while */
} else {
tempPath = srcPath + "\\ipframes.ins";
rc = SelectParameterValue (tempPath, /* INS file */
"Frame", /* Parameter */
frame, /* rtn value */
0, /* multiple */
TCPIP_FRAME_TYPE_INFO, /* instructions */
TCPIP_FRAME_TYPE_HELP, /* help */
TCPIP_FRAME_TYPE_INFO); /* info */
} /* end if */
/*
==============================================================================
= The default "Ethernet_II" may be wrong for a third party driver, but if =
= we don't have a .INS file, we can't tell what the driver might support. =
= The user will have to correct it if it is wrong. =
==============================================================================
*/
if (MLIDbasename != "NONE") {
PutProfileString ("Link Driver " + MLIDbasename,/* Application Name */
"Frame " + frame, /* Key Name */
" ", /* New Value */
pathNET_CFG, /* File Name */
"CFG"); /* File Type */
} /* end if */
/*
================================================================
= Find out if the user wants to install the SLIP/PPP driver. =
================================================================
*/
PushHelpContext (INSTALL_SLIP_HELP);
installSLIP = Confirm (INSTALL_SLIP, 18, 0, 0);
PopHelpContext();
if (installSLIP) {
sourceDirectory = GetSourcePath() + "NET\\BIN\\";
pathINS = sourceDirectory + "slip_ppp.ins";
PushHelpContext (CONFIGURE_MLID_HELP);
PushInformationText (2, CONFIGURE_SLIP_INFO);
rc = ConfigureMLID (pathINS, /* Path to .INS file */
pathNET_CFG, /* Path to NET.CFG to edit */
"", /* Skip list */
DMA_HELP, /* Help for DMA parameter */
FRAME_TYPE_HELP, /* Help for FRAME parameter */
INTERRUPT_HELP, /* Help for INT parameter */
MEMORY_ADDRESS_HELP,/* Help for MEM parameter */
NODE_ADDRESS_HELP, /* Help for NODE parameter */
PORT_HELP, /* Help for PORT parameter */
SLOT_HELP); /* Help for SLOT parameter */
PopHelpContext();
PopInformationText();
} /* end if */
/*
=================================================================
= Comment out the call to LANWP.BAT in the autoexec.bat file. =
=================================================================
*/
tempPath = GetTempDir();
AppendPath (tempPath, "INSTALL.TMP");
AddStatus (EDITING, AUTOEXEC_BAT, NO_MESSAGE);
if (silentcopy (pathAUTOEXEC_BAT, tempPath)) {
DisplayErrorCondition (FATAL);
} /* end if */
LWP41 = 0;
fh = fopen (tempPath, "r");
fho = fopen (pathAUTOEXEC_BAT, "w");
limit = 1;
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);
foundSET = 0;
if (1 == searchstr (scanLine, "SET" )) {
rc = 3; /* Skip the "set" keyword */
do {
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t"));
scanLine = substr (scanLine, rc, 255);
foundSET = 1;
} /* end if */
foundPATH = 0;
if (1 == searchstr (scanLine, "PATH")) {
ch = substr (scanLine, 5, 1);
if ((ch == "=") || (ch == " ") || (ch == "\t")) {
rc = 4; /* Skip the "path" keyword */
do {
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t") || (ch == "="));
scanLine = substr (scanLine, rc, 255);
rc = searchstr (scanLine, ":\\XLN\\BIN40");
if (rc) {
searchPath = substr (scanLine, 1, rc - 2) +
substr (scanLine, rc + 12, 255);
} else {
searchPath = scanLine;
} /* end if */
foundPATH = 1;
} /* end if */
} /* end if */
if (foundSET ||
foundPATH ||
(1 == searchstr (scanLine, "REM" )) ||
(1 == searchstr (scanLine, ":" ))) {
rc = fputs (inputLine, fho);
} else {
rc = searchstr (scanLine, " ");
if (!rc) rc = searchstr (scanLine, "\t");
if (rc) {
command = substr (scanLine, 1, rc - 1);
} else {
command = scanLine;
} /* end if */
splitpath (command, drive, directory, fname, ext);
if (searchstr (fname, "CALL")) {
do {
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t"));
scanLine = substr (scanLine, rc, 255);
rc = searchstr (scanLine, " ");
if (!rc) rc = searchstr (scanLine, "\t");
if (rc) {
command = substr (scanLine, 1, rc - 1);
} else {
command = scanLine;
} /* end if */
} /* end if */
splitpath (command, drive, directory, fname, ext);
if (fname == "LANWP") {
LWP41 = 1;
fputs ("REM " + inputLine, fho);
} else fputs (inputLine, fho);
} /* 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);
rc = fclose (fho);
/*
==========================================================
= Create a LANWP.BAT file which will start up the =
= existing ODI if LWP41, and the TCPIP transport =
==========================================================
*/
tempPath = "PATH " + targetPath + "\\BIN;" + searchPath;
if (strlen (tempPath) > 127) {
PushHelpContext (PATH_TOO_LONG_HELP);
Alert (PATH_TOO_LONG, 18, 0);
PopHelpContext();
} /* end if */
tempPath = "PATH " + targetPath + "\\BIN;%path%";
fh = fopen (GetTempDir() + "\\lanwp.bat", "w");
rc = fputs (targetPath + "\\BIN" + "\\yesno " + "\"Do you want to load the TCP/IP transport? [Y/N] \"", fh);
rc = fputs ("if errorlevel 1 goto noload", fh);
rc = fputs (tempPath, fh);
/*
==========================================================
= check and preserve NW shell and LWP "set name" if any =
= if it is LWP41 =
==========================================================
*/
if (bootType != BOOT_BY_RPL) {
sameLWP41dir = 0;
oldLANWP_BAT = bootDrive + "\\lanwp.bat";
if (LWP41 && IsFile (oldLANWP_BAT)) {
fho = fopen (oldLANWP_BAT, "r");
fc = fgets (inputLine, fho);
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 (!searchstr(scanLine, "YESNO") && !searchstr(scanLine, "NOLOAD") &&
!searchstr(scanLine, "PATH") && !searchstr(scanLine, "BREAK") &&
!searchstr(scanLine, "TCPIP"))
rc = fputs (inputLine, fh);
if (1 == searchstr (scanLine, "PATH")) {
if (searchstr (scanLine, targetPath)) sameLWP41dir = 1;
if (!sameLWP41dir) {
ch = substr (scanLine, 5, 1);
if ((ch == "=") || (ch == " ") || (ch == "\t")) {
rc = 4; /* Skip the "path" keyword */
do {
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t") || (ch == "="));
oldLWP41path = substr (scanLine, rc, 255);
}
}
}
fc = fgets (inputLine, fho);
} /* end while */
fclose (fho);
}
}
/*
======================================
= Invoke SLIP_PPP.COM if requested =
======================================
*/
if (installSLIP) rc = fputs ("\\slip_ppp.com", fh);
rc = fclose (fh);