home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / utils / wpprg / install.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-27  |  886 b   |  42 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.       return 1;
  19.    }
  20.  
  21.    strcpy(myPath, argv[1]);
  22.    strcat(myPath, ":\\OS2\\DLL\\wpprgext.dll");
  23.  
  24.    WinDeregisterObjectClass("WPPrgExt");
  25.    rc = WinRegisterObjectClass("WPPrgExt", (PSZ)myPath);
  26.  
  27.    if (!rc) {
  28.       printf("Unable to register the class\n\n");
  29.       return 1;
  30.    }
  31.  
  32.    rc = WinReplaceObjectClass("WPProgram", "WPPrgExt", TRUE);
  33.  
  34.    if (!rc) {
  35.       printf("Unable to replace WPPrgram class\n\n");
  36.       return 1;
  37.    }
  38.  
  39.    printf("Installation is completed\n\n");
  40.    return 0;
  41. }
  42.