home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qsetup.zip / DM2TEST.CMD < prev    next >
OS/2 REXX Batch file  |  1994-04-25  |  2KB  |  56 lines

  1. /* REXX - DM2Test: DeskMan/2 setup test object install program      */
  2. /*-──────────────────────────────────────────────────────────────────┐
  3. │                                                                    │
  4. │  (C) Copyright 1993-1994 Development Technologies, Inc.            │
  5. │      Portions Copyright 1993 Gregory Czaja                         │
  6. │      All rights reserved                                           │
  7. │      DeskMan, DeskMan/2, DM2Setup, VUEMan, VUEMan/2 and DM2Image   │
  8. │      are trademarks of Development Technologies, Inc. (DevTech),   │
  9. │      a Pennsylvania Corporation                                    │
  10. │                                                                    │
  11. │  version 1.5                                         April 1994    │
  12. └───────────────────────────────────────────────────────────────────*/
  13.  
  14. Parse source . . __rexx_name;
  15. __rexx_dir = Filespec('D',__rexx_name)||Filespec('P',__rexx_name)
  16.  
  17. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
  18. Call SysLoadFuncs;           
  19.  
  20.      system_dll = FileSpec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))||'\OS2\DLL';
  21.      rc = SysDestroyObject("<DM2Test>");
  22.      rc = SysDeregisterObjectClass('DM2Test');
  23.  
  24.      Address CMD '@ERASE 'system_dll'\DM2Test.DLL 2>NUL';
  25.  
  26.      Say "Install (I) or Remove (R)?"; Pull reply;
  27.      If Translate(reply) = 'R'
  28.         Then Exit;
  29.  
  30.      Address CMD '@COPY '__rexx_dir'DM2Test.DLL 'system_dll;
  31.  
  32.      If rc <> 0                 /* registered OK ?                */
  33.         Then Do;
  34.           Say  "DM2 Test: could not replace the DLL, rc="rc".";
  35.           Say  "DM2 Test: delete the object and the DLL from \OS2\DLL directory.";
  36.           Exit;
  37.           End;
  38.  
  39.      rc = SysRegisterObjectClass('DM2Test',system_dll||'\DM2Test.DLL');
  40.  
  41.      If rc <> 1                 /* registered OK ?                */
  42.         Then Do;
  43.           Say  "DM2 Test: could not register its object class, rc="rc".";
  44.           Exit;
  45.           End;
  46.  
  47.      rc = SysCreateObject('DM2Test','DM/2Test','<WP_DESKTOP>', ,
  48.                         'OBJECTID=<DM2Test>;',,
  49.                         'ReplaceIfExists');
  50.  
  51.      If rc <> 1                 /* registered OK ?                */
  52.         Then Do;
  53.           Say  "DM2 Test: could not create its object, rc="rc".";
  54.           End;
  55. Exit;
  56.