home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / trshsqrt.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1995-11-19  |  1KB  |  65 lines

  1. /*
  2.  * Install Trashcan class, object
  3.  * (c) Henicke, Andreas 1995 Rostock
  4.  */
  5.  
  6. dllname     ='trashcan.dll'
  7. template    ='\os2\dll'
  8. osver       =230
  9. objectid    ='<TRASHCAN>'
  10. objectname  ='Trashcan'
  11. classid     ='WPTrashCan'
  12.  
  13. parse arg arglist .
  14. call rxfuncadd 'sysloadfuncs','rexxutil','sysloadfuncs'
  15. call sysloadfuncs
  16.  
  17. parse value sysos2ver() with major'.'minor
  18.  
  19. veros2=major*100+left(minor,2,0)
  20.  
  21. /* test os/2 version (os/2 warp3: 2.30) */
  22. if veros2<osver then do
  23.    say 'need OS version ' osver ' and above'
  24.    exit
  25. end
  26.  
  27. /* PrÜfe vorhandene Dateien */
  28. call sysfiletree '.\'||dllname,   ll0, 'FO'
  29. if ll0.0=0 then do
  30.    say 'error: miss ' dllname
  31.    exit
  32. end
  33.  
  34. /* get [d:]\os2\dll directory */
  35. path=''
  36. ds=sysdrivemap(c, local)
  37. do di=1 to ((length(ds)+1)/3)-1
  38.    dd=word(ds, di);
  39.    call sysfiletree dd || template, dl, 'DO'
  40.    if dl.0<>0 then do
  41.       path=translate(dl.1)
  42.       leave
  43.    end
  44. end
  45. if path=='' then do
  46.    say 'error: miss ' template
  47.    exit
  48. end
  49. dllpath=translate(path || '\' || dllname)
  50. call sysfiletree dllpath, tl, 'FO'
  51. if tl.0<>0 then do
  52.    say 'error: found' dllpath
  53.    exit
  54. end
  55.  
  56. /* copy trashcan.dll in [d:]\os2\dll */
  57. address cmd '@copy' dllname dllpath '> NUL'
  58.  
  59. /* register class and create object <TRASHCAN> */
  60. call sysregisterobjectclass classid, dllpath
  61. call syscreateobject classid, objectname, '<WP_DESKTOP>', 'OBJECTID='||objectid
  62.  
  63. exit
  64.  
  65.