home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
vlmkt6.exe
/
WS_DONE.CPF
< prev
next >
Wrap
Text File
|
1993-09-28
|
5KB
|
207 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_DONE,
/* CompVer */ 4.1,
/* CompStatus */ Retail
);
int found;
int sourceVersion;
int targetVersion;
string pathLANWP_BAT;
string fileName[6];
string fileExt[6];
int limit;
int i;
int f;
string sourceFile;
string targetFile;
string editedFile;
int fh; /* File handle for fopen, etc. */
string command;
int rc;
/*
====================================================================
= Get the boot disk back in the FDU if workstation boots by FDU. =
====================================================================
*/
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 */
/*
========================================
= Save the existing \LANWP.BAT file. =
========================================
*/
pathLANWP_BAT = bootDrive + "\\lanwp.bat";
if (IsFile (pathLANWP_BAT)) {
pathLANWP_BAT = bootDrive + "\\olanwp.bat";
i = 0;
while (IsFile (pathLANWP_BAT)) {
pathLANWP_BAT = bootDrive + "\\olanwp" + itoa (i, 10) + ".bat";
i = i + 1;
} /* end while */
rename (bootDrive + "\\lanwp.bat", pathLANWP_BAT);
} /* end if */
if (copy (GetTempDir() + "\\lanwp.bat", bootDrive + "\\lanwp.bat")) {
DisplayErrorCondition (FATAL);
} /* end if */
/*
=====================================================
= Copy the system files based on the update flag. =
=====================================================
*/
fileName[0] = bootDrive + "\\AUTOEXEC";
if (req40) {
fileName[1] = req40PATH + "NET";
} else {
fileName[1] = bootDrive + "\\NET";
}
fileName[2] = windowsDirectory + "\\SYSTEM";
fileExt[0] = ".BAT";
fileExt[1] = ".CFG";
fileExt[2] = ".INI";
f = (bootType == BOOT_BY_RPL) ? 1 : 0;
limit = (WS_LWP_W) ? 2 : 1;
do {
sourceFile = fileName[f] + fileExt[f];
targetFile = fileName[f] + ".LWP";
i = 0;
while ((i <= 9) && IsFile (targetFile)) {
targetFile = fileName[f] + ".LW" + itoa (i, 10);
i = i + 1;
} /* end while */
if (f == 0) {
editedFile = pathAUTOEXEC_BAT;
} else if (f == 1) {
editedFile = pathNET_CFG;
} else if (f == 2) {
editedFile = pathSYSTEM_INI;
} /* end if */
if (updateSystemFiles) {
if (IsFile (sourceFile)) {
if (copy (sourceFile, targetFile)) {
DisplayErrorCondition (FATAL);
} /* end if */
} /* end if */
if (IsFile (editedFile)) {
if (copy (editedFile, sourceFile)) {
DisplayErrorCondition (FATAL);
} /* end if */
} /* end if */
if (IsFile (targetFile)) {
if (copy (targetFile, editedFile)) {
DisplayErrorCondition (FATAL);
} /* end if */
} /* end if */
} else {
if (IsFile (editedFile)) {
if (copy (editedFile, targetFile)) {
DisplayErrorCondition (FATAL);
} /* end if */
} /* end if */
if (IsFile (sourceFile)) {
if (copy (sourceFile, editedFile)) {
DisplayErrorCondition (FATAL);
} /* end if */
} /* end if */
} /* end if */
f = f + 1;
} while (f <= limit);
/*
====================================
= Create the uninstall.bat file. =
====================================
*/
fileName[0] = bootDrive + "\\autoexec.bat";
if (req40) fileName[1] = req40PATH + "net.cfg";
else fileName[1] = bootDrive + "\\net.cfg";
fileName[2] = windowsDirectory + "\\system.ini";
fh = fopen (targetPath + "\\INSTALL\\uninstal.bat", "w");
rc = fputs ("echo off", fh);
if (bootType == BOOT_BY_FDU) {
rc = fputs ("echo " + GetMessage (BOOT_DISK_PROMPT), fh);
rc = fputs ("pause", fh);
} /* end if */
command = "copy " + targetPath + "\\INSTALL\\";
if (bootType != BOOT_BY_RPL) {
rc = fputs (command + "autoexec.bat " + fileName[0], fh);
} /* end if */
rc = fputs (command + "net.cfg " + fileName[1], fh);
if (WS_LWP_W) {
rc = fputs (command + "system.ini " + fileName[2], fh);
} /* end if */
rc = fclose (fh);
/*
======================
= Hey, we're done. =
======================
*/
if (updateSystemFiles) {
DisplayHelp (WS_DONE_UPDATE_HELP);
PushHelpContext (WS_DONE_UPDATE_HELP);
} else {
DisplayHelp (WS_DONE_NO_UPDATE_HELP);
PushHelpContext (WS_DONE_NO_UPDATE_HELP);
} /* end if */