home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / mshred.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1996-01-10  |  2KB  |  70 lines

  1. /*
  2.  * mshred installation program.
  3.  *
  4.  * Run as "INSTALL DEINSTALL" to deinstall mshred.
  5.  * Anything else installs mshred.
  6.  *
  7.  * Hector wuz here.
  8.  */
  9.  
  10. '@cls'
  11. say ''
  12. say ' New WPS object "mshred," a shredder that deletes most anything.'
  13. say ' Also has a "trashcan"-mode.  Copy or link drop for a bonus.'
  14. say ''
  15. say ' Copyright (c) 1995/96 by M. Kimes -- all rights reserved.'
  16. say ' But free-for-the-using.  No warranty.'
  17. say ''
  18.  
  19. parse upper arg dummy
  20.  
  21. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  22. Call SysLoadFuncs
  23.  
  24. /* Get system DLL directory path */
  25. system_dll=FileSpec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))||'\OS2\DLL'
  26.  
  27. /* deregister class */
  28. call SysDeregisterObjectClass 'mshred'
  29. /* delete object */
  30. call SysDestroyObject '<MSHRED>'
  31.  
  32. /* Erase old DLL */
  33. '@ERASE 'system_dll'\mshred.dll 2>NUL'
  34.  
  35. if dummy = 'DEINSTALL' then  /* INSTALL DEINSTALL to deinstall mshred */
  36. do
  37.   say "mshred is uninstalled."
  38.   Exit
  39. end
  40.  
  41. say "Copying DLL system directory..."
  42. /* Copy new DLL to system DLL dir */
  43. '@COPY mshred.dll 'system_dll
  44.  
  45. say "Registering mshred class..."
  46. /* Register mshred class */
  47. rc = SysRegisterObjectClass('mshred',system_dll||'\MSHRED.DLL')
  48.  
  49. If rc <> 1                 /* If mshred class did not register OK */
  50.   Then Do
  51.     Say "mshred: could not register mshred class, rc="rc"."
  52.     Exit
  53.   End
  54.  
  55. say "Creating mshred desktop object..."
  56. /* Now create object on Desktop */
  57. rc = SysCreateObject('mshred','The Mangler','<WP_DESKTOP>',,
  58.                      'OBJECTID=<MSHRED>;','replace')
  59.  
  60. If rc <> 1                 /* If there were create errors... */
  61.   Then Do
  62.     Say "mshred: couldn't create object on the Desktop, rc="rc"."
  63.     Exit
  64.   End
  65.  
  66. say ''
  67. say " mshred installation is complete."
  68. say ''
  69. say " Run 'INSTALL DEINSTALL' to uninstall mshred if desired."
  70.