home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / mkbko021.zip / Install.cmd next >
OS/2 REXX Batch file  |  1995-03-16  |  1KB  |  52 lines

  1. /*
  2.  
  3.    Installs the MkBkObj utility on the Desktop
  4.  
  5.    (C) 1994-95 by Ralf G. R. Bergs <rabe@rwth-aachen.de>
  6.    Released as "Freeware"
  7.  
  8.  */
  9.  
  10. '@echo off'
  11.  
  12. parse source progname
  13. progname = word( progname, 3 )
  14.  
  15. Say "Where do you want to install MkBkObj? (<CR> to quit) "
  16. pull dest
  17. if dest="" then do
  18.   exit
  19. end
  20. 'copy' MkBkObj.cmd dest
  21.  
  22. /* strip trailing backslash in "?:\" or "?:\foobar\" style paths */
  23. if lastpos( "\", dest ) = length( dest ) then do
  24.   dest = left( dest, length( dest ) - 1 )
  25. end
  26.  
  27. needfunc = RxFuncQuery( 'SysCreateObject' )
  28. if needfunc then do
  29.   ret = RxFuncAdd( 'SysCreateObject', 'RexxUtil', 'SysCreateObject' )
  30.   if ret then do
  31.     say progname || ": Error: Registration of 'SysCreateObject' failed."
  32.     exit 1
  33.   end
  34. end /* if needfunc */
  35.  
  36. ret = SysCreateObject( 'WPProgram', 'Make Book^Object', '<WP_DESKTOP>', ,
  37.         'OBJECTID=<MkBkObj>;EXENAME=' || dest || '\MkBkObj.CMD' || ,
  38.         ';MINIMIZED=YES', 'U' )
  39.  
  40. if \ret then do
  41.   say progname || ": Error: Creation of object <MkBkObj> failed."
  42.   exit 1
  43. end
  44.  
  45. if needfunc then do
  46.   ret = RxFuncDrop( 'SysCreateObject' )
  47.   if ret then do
  48.     say progname || ": Error: De-registration of 'SysCreateObject' failed."
  49.     exit 1
  50.   end
  51. end /* if needfunc */
  52.