home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / WPPRG15.ZIP / INSTALL.C < prev    next >
Text File  |  1993-11-29  |  908b  |  41 lines

  1. #define INCL_WINWORKPLACE
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <os2.h>
  6.  
  7.  
  8. main(int argc, char *argv[], char *envp[])
  9. {
  10.    CHAR myPath[256];
  11.    BOOL rc;
  12.  
  13.    if (argc != 2 || strlen(argv[1]) != 1) {
  14.       printf("Usage : \n\n");
  15.  
  16.       printf("install x\n");
  17.       printf("     - where x is the os/2 system drive\n\n");
  18.    }
  19.    else {
  20.       strcpy(myPath, argv[1]);
  21.       strcat(myPath, ":\\OS2\\DLL\\wpprgext.dll");
  22.  
  23.       WinDeregisterObjectClass("WPPrgExt");
  24.       rc = WinRegisterObjectClass("WPPrgExt", (PSZ)myPath);
  25.  
  26.       if (!rc)
  27.          printf("Unable to register the class\n\n");
  28.       else {
  29.  
  30.          rc = WinReplaceObjectClass("WPProgram", "WPPrgExt", TRUE);
  31.  
  32.          if (!rc)
  33.             printf("Unable to replace WPPrgram class\n\n");
  34.    
  35.          else
  36.             printf("Installation is completed\n\n");
  37.  
  38.       }
  39.    }
  40. }
  41.