home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
vlmkt6.exe
/
WS_CONF.CPF
< prev
next >
Wrap
Text File
|
1993-09-28
|
13KB
|
448 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_CONF,
/* CompVer */ 4.1,
/* CompStatus */ Retail
);
static string windowsDirectory;
static string targetDrive; /* Drive LWP is installed to */
static int bootType; /* How the workstation boots up */
static string bootDrive; /* Where ODI and Netware for DOS are placed */
static int updateSystemFiles; /* 0 = make another copy with changes */
static string pathAUTOEXEC_BAT; /* Path to system file to edit */
static string pathCONFIG_SYS; /* Path to system file to edit */
static string pathNET_CFG; /* Path to system file to edit */
static string pathPROGMAN_INI; /* Path to system file to edit */
static string pathSYSTEM_INI; /* Path to system file to edit */
static string pathWIN_INI; /* Path to system file to edit */
static string targetPath; /* Destination tree directory names */
static string bootSourceFile[10];
static string bootTargetFile[10];
static int bootIndex;
int found; /* Flag for testing in loops */
int width; /* Width of list window */
string savePath;
int rc; /* Return value from various functions */
int requiredDiskSpace;
string targetName[10];
int i; /* Loop control variable */
string targetDirectory;
int limit; /* Number of system files to process */
int f; /* Loop control variable */
string sourceFile; /* Temporary variable */
string targetFile; /* Temporary variable */
string editFile; /* Temporary variable */
int fh; /* File handle index */
static int req40; /* flag indicating whether is 4.0 requester */
static string req40PATH;
int fc;
string inputLine;
string scanLine;
string ch;
static string MLIDbasename;
/*
=================================================
= Check to see if LSL is loaded (required) =
=================================================
*/
if (!GetMLIDList (MLIDbasename)) {
DisplayErrorText (ODI_NOT_PRESENT, FATAL);
exit(0);
}
/* Initialization */
DisplayHelp (NWC_WELCOME_HELP);
PushHelpContext (IN_PROGRESS_HELP);
bootIndex = 0;
/*
=================================================
= Check to see if Windows is in the DOS PATH. =
=================================================
*/
windowsDirectory = which ("win.ini");
TrimPath (windowsDirectory);
if (windowsDirectory == "") {
/*
=================================
= Windows is not in the path. =
=================================
*/
WS_LWP_W = 0;
found = 0;
} else {
if (IsFile (windowsDirectory + "\\system.ini")) {
/*
=============================
= Windows has been found. =
=============================
*/
WS_LWP_W = 1;
found = 1;
} else {
/*
==============================================================
= If this is a windows directory, it is a pre-3.0 Windows. =
= Since a pre-3.0 Windows is not supported, we don't not =
= normally load the Windows applications. =
==============================================================
*/
WS_LWP_W = 0;
found = 0;
} /* end if */
} /* end if */
/*
=================================================
= Get information about Windows installation. =
=================================================
*/
while (!found && (WS_LWP_W)) {
PushHelpContext (WIN_DIR_PATH_HELP);
EditString (17, /* Center Line */
0, /* Center Column */
1, /* Height */
70, /* Width */
WINDOWS_DIR_HEADER, /* Header */
WINDOWS_DIR_PROMPT, /* Prompt */
windowsDirectory, /* String Value */
EF_UPPER | EF_NOSPACES); /* Edit Flags */
PopHelpContext();
if (IsFile (windowsDirectory + "\\win.ini") &&
IsFile (windowsDirectory + "\\system.ini")) {
found = 1;
} else {
found = 0;
Alert (WINDOWS_DIR_NOT_FOUND, 18, 0);
PushInformationText (2, YOU_MAY_WIN_DIR_MSG);
InitList();
width = AppendToList (CONTINUE_WITHOUT_WINDOWS, FATAL);
rc = AppendToList (SPECIFY_A_NEW_PATH, FATAL);
if (width < rc) width = rc;
rc = AppendToList (EXIT_TO_DOS, FATAL);
if (width < rc) width = rc;
List (YOU_MAY, /* headerText */
18, /* centerLine */
0, /* centerColumn */
YOU_MAY_WIN_DIR_HELP, /* helpText */
3, /* visibleHeight */
width, /* visibleWidth */
0, /* multipleSelectFlag */
rc); /* result */
DestroyList();
PopInformationText();
if (rc == CONTINUE_WITHOUT_WINDOWS) {
WS_LWP_W = 0;
} else if (rc == EXIT_TO_DOS) {
rc = VerifyProgramExit();
if (rc) exit (2);
} /* end if */
} /* end if */
} /* end while */
/*
=================================================
= Figure out how much disk space is required. =
=================================================
*/
requiredDiskSpace = 1500;
/*
==========================
= Find a target drive. =
==========================
*/
PushHelpContext (DEST_DRIVE_HELP);
PushInformationText (2, DEST_DRIVE_INFO);
targetDrive = GetDestDrive (DEST_DRIVE_HEADER, /* Header */
17, 0, /* Location */
requiredDiskSpace, /* Minimum free space */
0, /* Server only flag */
DEST_DRIVE_HELP, /* Help message */
WS_NO_SPACE_HELP); /* Insuficient space help */
PopInformationText();
PopHelpContext();
/*
===================================================
= Set the default path and ask user to edit it. =
===================================================
*/
rc = GetDriveType (targetDrive);
if (rc == 9) {
savePath = getcwd(); /* Network drive */
chdir (targetDrive);
targetPath = getcwd();
chdir (savePath);
} else {
targetPath = targetDrive; /* Local drive */
} /* end if */
AppendPath (targetPath, "NET");
PushInformationText (2, TARGET_DIR_INFO);
PushHelpContext (TARGET_DIR_HELP);
EditString (17, /* Center Line */
0, /* Center Column */
1, /* Height */
70, /* Width */
SELECT_DIRECTORY, /* Header */
TARGET_DIR_PROMPT, /* Prompt */
targetPath, /* String Value */
EF_UPPER | EF_NOSPACES); /* Edit Flags */
PopHelpContext();
PopInformationText();
/*
======================================================
= Make sure that no extra '\' appended to the path =
======================================================
*/
strupr (targetPath);
i = strlen (targetPath);
if (substr(targetPath,i,1) == "\\") {
targetPath = substr(targetPath, 1, i-1);
}
/*
==================================
= Make the target directories. =
==================================
*/
if (mkdir (targetPath)) {
DisplayErrorCondition (FATAL);
} /* end if */
targetName[0] = "\\BIN";
targetName[1] = "\\INSTALL";
targetName[2] = "\\SAMPLE";
targetName[3] = "\\TCP";
i = 0;
do {
targetDirectory = targetPath + targetName[i];
if (mkdir (targetDirectory)) {
DisplayErrorCondition (FATAL);
} /* end if */
i = i + 1;
} while (i <= 3);
/*
==============================================================================
= The system message and overlay files are used by the product, so copy =
= them into the bin directory. =
==============================================================================
*/
targetName[0] = "$run.ovl"; /* Do not reorder elements 0 - 4 */
targetName[1] = "ibm$run.ovl";
targetName[2] = "sys$err.dat";
targetName[3] = "sys$help.dat";
targetName[4] = "sys$msg.dat";
targetDirectory = targetPath + "\\BIN";
i = 0;
do {
if (copy (GetSourcePath() + targetName[i], targetDirectory)) {
DisplayErrorCondition (FATAL);
} /* end if */
i = i + 1;
} while (i <= 4);
/*
=============================================================
= Find out what kind of boot is done on this workstation. =
=============================================================
*/
PushHelpContext (RPL_BOOT_HELP);
PushInformationText (2, RPL_BOOT_INFO);
bootType = Confirm (RPL_BOOT_QUESTION, 18, 0, 0);
PopInformationText();
PopHelpContext();
if (bootType) bootType = BOOT_BY_RPL;
/*
=================================
= Get boot drive information. =
=================================
*/
if (bootType == BOOT_BY_RPL) {
WS_ODI = 0;
bootDrive = targetDrive;
} else {
bootDrive = GetBootDrive (17, /* Center line */
0, /* Center column */
BOOT_DRIVE_HEADER, /* Header */
BOOT_DRIVE_HELP); /* Help */
rc = GetDriveType (bootDrive);
if (rc == 6) {
bootType = BOOT_BY_HDU;
} else {
bootType = BOOT_BY_FDU;
} /* end if */
} /* end if */
/*
==============================================================================
= Ask if system files should be updated or not. Make backups and choose =
= which file to edit as appropriate to the answer. =
==============================================================================
*/
PushHelpContext (UPDATE_SYSTEM_FILES_HELP);
PushInformationText (2, UPDATE_SYSTEM_FILES_MSG);
updateSystemFiles = Confirm (UPDATE_SYSTEM_FILES_PROMPT, 18, 0, 1);
PopInformationText();
PopHelpContext();
if (updateSystemFiles) {
DisplayHelp (WS_SYS_FILE_EDIT_HELP);
} else {
DisplayHelp (WS_SYS_FILE_BACKUP_HELP);
} /* end if */
/*
========================
= Get the boot disk. =
========================
*/
if (bootType == BOOT_BY_FDU) {
found = 0;
do {
PushHelpContext (INSERT_BOOT_DISK_HELP);
DisplayInformation (NO_MESSAGE, 18, 0, INSERT_BOOT_DISKETTE);
PopHelpContext();
if (IsFile (bootDrive + "\\IO.SYS") &&
IsFile (bootDrive + "\\MSDOS.SYS")) {
found = 1;
} /* end if */
if (IsFile (bootDrive + "\\IBMBIO.COM") &&
IsFile (bootDrive + "\\IBMDOS.COM")) {
found = 1;
} /* end if */
} while (!found);
} /* end if */
/*
==================================================================
= Copy system files to the NET\INSTALL directory to be edited. =
==================================================================
*/
targetName[0] = bootDrive + "\\AUTOEXEC.BAT";
/*
==============================================================
= Find out whether NetWare 4.0/4.01 requester is installed =
==============================================================
*/
req40 = 0;
if (IsFile (targetName[0])) {
fh = fopen (targetName[0], "r");
fc = fgets (inputLine, fh);
while (fc) {
scanLine = inputLine;
strupr (scanLine);
rc = 0;
do {
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t"));
scanLine = substr (scanLine, rc, 255);
if ( (1 != searchstr (scanLine, "REM")) &&
(f = searchstr (scanLine, "STARTNET")) ) {
i = searchstr (scanLine, "CALL");
rc = 0;
if ( i ) rc = i + 4 - 1;
do {
rc = rc + 1;
ch = substr (scanLine, rc, 1);
} while ((ch == " ") || (ch == "\t"));
req40PATH = substr (scanLine, rc, f - rc);
req40 = 1;
fc = 0; /* force to terminate while loop */
} else {
fc = fgets (inputLine, fh);
}
}
fclose (fh);
}
if (IsLSLPresent (targetName[1])) {
if (!IsFile (targetName[1])) targetName[1] = bootDrive + "\\NET.CFG";
} else {
targetName[1] = bootDrive + "\\NET.CFG";
} /* end if */
if (req40) targetName[1] = req40PATH + "NET.CFG";
targetName[2] = windowsDirectory + "\\SYSTEM.INI";
pathAUTOEXEC_BAT = targetPath + "\\INSTALL\\autoexec.bat";
pathNET_CFG = targetPath + "\\INSTALL\\net.cfg";
pathSYSTEM_INI = targetPath + "\\INSTALL\\system.ini";
i = (bootType == BOOT_BY_RPL) ? 1 : 0;
limit = (WS_LWP_W) ? 2 : 1;
do {
if (IsFile (targetName[i])) {
if (copy (targetName[i], targetPath + "\\INSTALL")) {
DisplayErrorCondition (FATAL);
} /* end if */
} else {
if (i == 0) { /* Create the file */
fh = fopen (pathAUTOEXEC_BAT, "w");
} else if (i == 1) {
fh = fopen (pathNET_CFG, "w");
} else if (i == 2) {
fh = fopen (pathSYSTEM_INI, "w");
} /* end if */
rc = fputs ("", fh);
rc = fclose (fh);
} /* end if */
i = i + 1;
} while (i <= limit);
/*
================================
= Get the install disk back. =
================================
*/
if (bootType == BOOT_BY_FDU) {
GetCurrentDiskette (GetSourcePath() + "$run.ovl");
} /* end if */