home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / vlmkt6.exe / WS_LWP_W.CPF < prev    next >
Text File  |  1993-09-28  |  4KB  |  135 lines

  1. /*
  2. **      Copyright (c) 1992 Novell, Inc.  All Rights Reserved.
  3. **
  4. **      THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS 
  5. **      AND TREATIES. NO PART OF THIS WORK MAY BE USED, PRACTICED, 
  6. **      PERFORMED COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED, 
  7. **      ABRIDGED, CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, 
  8. **      RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT
  9. **      OF NOVELL, INC.  ANY USE OR EXPLOITATION OF THIS WORK WITHOUT 
  10. **      AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO CRIMINAL AND CIVIL
  11. **      LIABILITY.
  12. */
  13.  
  14. syntax (1.1);
  15.  
  16. component (
  17.     /* CompID     */    WS_LWP_W,
  18.     /* CompVer    */    4.1,
  19.     /* CompStatus */    Retail
  20. );
  21.  
  22.     string    targetName[49];    /* Names of the files */
  23.     string    sourceName[3];    /* Names of the files */
  24.     string    backupName[3];    /* Names of the files */
  25.     string    sourceDirectory;
  26.     string    targetDirectory;
  27.     int    i;        /* Loop counter */
  28.     string    systemDirectory;    /* Path to Windows\system directory */
  29.     string    sourceFile;    /* File names including path */
  30.     string    iniString;    /* Value from/for .INI files */
  31.     int    rc;        /* Return code from various functions */
  32.     string    lwpGrpPath;
  33.     string    dummy;        /* Dummy variable */
  34.     string    group;
  35.     int    count;        /* Number of devices found in system.ini */
  36.     string    tempPath;    /* Path to temporary files */
  37.     int    fh;        /* File handle for fopen, etc. */
  38.     int    fho;        /* Output file handle for fopen, etc. */
  39.     int    fc;        /* Return code from fgets when rc is busy */
  40.     string    inputLine;    /* Line read from file */
  41.     string    scanLine;
  42.     string    resolution;    /* Temporary string */
  43.     string    baseName;    /* Temporary string */
  44.     string    displayType;    /* Temporary string */
  45.     string    loc;
  46.     int    lineNumber;
  47.     int    pushed;
  48.     int    vSrc;
  49.     int    vDst;
  50.  
  51.  
  52. /*
  53. ================================
  54. =  Save the old wlibsock.dll.  =
  55. ================================
  56. */
  57. if (IsFile (windowsDirectory + "\\wlibsock.dll")) {
  58.     sourceName = windowsDirectory + "\\wlibsock.dll";
  59.     targetName = windowsDirectory + "\\wlibsock.old";
  60.     rename (sourceName, targetName);
  61.  
  62.     DisplayHelp (RENAME_WLIBSOCK_HELP);  
  63. } /* end if */
  64.  
  65.  
  66. /*
  67. ======================
  68. =  Edit SYSTEM.INI.  =
  69. ======================
  70. */
  71. tempPath = GetTempDir();
  72. AppendPath (tempPath, "INSTALL.TMP");
  73.  
  74. AddStatus (EDITING, SYSTEM_INI, NO_MESSAGE);
  75.  
  76. if (silentcopy (pathSYSTEM_INI, tempPath)) {
  77.     DisplayErrorCondition (FATAL);
  78. } /* end if */
  79.  
  80. fh = fopen (tempPath, "r");
  81. fho = fopen (pathSYSTEM_INI, "w");
  82.  
  83. loc = "before";
  84. fc = fgets (inputLine, fh);
  85. scanLine = inputLine;
  86. strupr (scanLine);
  87. lineNumber = 1;
  88. pushed = 0;
  89. while (fc) {
  90.     if ((loc == "before") && searchstr (scanLine, "[386ENH]")) {
  91.         rc = fputs (inputLine, fho);
  92.         rc = fputs ("device=" + targetPath + "\\BIN\\vtcpip.386", fho);
  93.         loc = "in";
  94.     } else if ((loc == "in") && searchstr (scanLine, "VTCPIP.386")) {
  95.         /* Skip the line */
  96.     } else if ((loc == "in") && searchstr (scanLine, "[")) {
  97.         rc = fputs (inputLine, fho);
  98.         loc = "after";
  99.     } else {
  100.         rc = fputs (inputLine, fho);
  101.     } /* end if */
  102.  
  103.     fc = fgets (inputLine, fh);
  104.     scanLine = inputLine;
  105.     strupr (scanLine);
  106.  
  107.     if (!(lineNumber % 5)) {
  108.         if (pushed) {
  109.             PopInformationText();
  110.             pushed = 0;
  111.         } else {
  112.             PushInformationText (2, STILL_EDITING);
  113.             pushed = 1;
  114.         } /* end if */
  115.     } /* end if */
  116.     lineNumber = lineNumber + 1;
  117. } /* end while */
  118. if (pushed) PopInformationText();
  119.  
  120. rc = fclose (fh);
  121. rc = fclose (fho);
  122.  
  123. rc = PutProfileString ("386Enh",        /* appName */
  124.                "TimerCriticalSection",    /* keyName */
  125.                "10000",            /* valueString */
  126.                pathSYSTEM_INI,        /* fileName */
  127.                "INI");            /* file type */
  128.  
  129. rc = PutProfileString ("NetWare",        /* appName */
  130.                "NWShareHandles",    /* keyName */
  131.                "TRUE",            /* valueString */
  132.                pathSYSTEM_INI,        /* fileName */
  133.                "INI");            /* file type */
  134.  
  135.