home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / viewit12.zip / ViewIt.cmd < prev    next >
OS/2 REXX Batch file  |  1994-12-04  |  1KB  |  45 lines

  1. /* rexx - ViewIt: install ViewIt's DLL and create its object */
  2.  
  3. Parse source . . __rexx_name;
  4. __rexx_dir = Filespec('D',__rexx_name)||Filespec('P',__rexx_name)
  5.  
  6. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
  7. Call SysLoadFuncs;           
  8.  
  9. Say 'Installing ViewIt and creating its object on Desktop. Please wait...'
  10.  
  11. sObject='ViewIt'
  12. sObjectID='<VIEWIT>'
  13. sDLL='ViewIt.dll'
  14. sTitle='ViewIt 1.2'
  15.  
  16. system_dll=FileSpec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))||'\OS2\DLL';
  17. rc=SysDeregisterObjectClass('ViewIt');
  18. Address CMD '@ERASE 'system_dll'\'sDLL' 2>NUL';
  19. Address CMD '@COPY '__rexx_dir''sDLL' 'system_dll' 2>NUL';
  20.  
  21. If rc <> 0                 /* registered OK ?                */
  22.    Then Do;
  23.      Say  sObject": could not replace "sDLL", rc = "rc".";
  24.      Say  sObject": delete the object and "sDLL" from "system_dll" directory.";
  25.      Exit;
  26.    End;
  27.  
  28. rc=SysRegisterObjectClass(sObject,system_dll||'\'sDLL);
  29.  
  30. If rc <> 1                 /* registered OK ?                */
  31.    Then Do;
  32.      Say  sObject": could not register its object class, rc = "rc".";
  33.      Exit;
  34.    End;
  35.  
  36. rc=SysCreateObject(sObject,sTitle,'<WP_DESKTOP>', ,
  37.    'OBJECTID='sObjectID';','ReplaceIfExists');
  38.  
  39. If rc <> 1                 /* registered OK ?                */
  40.    Then Do;
  41.      Say  sObject": could not create its object, rc = "rc".";
  42.    End;
  43. Exit;
  44.  
  45.