home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / enh_e130.zip / PostPlug.cmd < prev    next >
OS/2 REXX Batch file  |  1999-12-09  |  2KB  |  48 lines

  1. /*********************************************************/
  2. /* Additional work for the Enhanced E installation       */
  3. /* This script is run as the "PostPlugin" at close       */
  4. /* and adds a "PlugIns" directory as well as changing    */
  5. /* "UnInstal.cmd" to remove it at uninstallation time    */
  6. /* and to remove entries made to os2.ini                 */
  7. /*********************************************************/
  8. parse source . . ThisProgram
  9.  
  10. crlf        = '0d0a'x
  11. ThisDir        = Left(ThisProgram, lastpos('\', ThisProgram)-1)
  12. UnInstall    = InstDir||'\UnInstal.cmd'
  13.  
  14. /*********************************************************/
  15. /* Make the "PlugIns" directory and move files to it     */
  16. /*********************************************************/
  17. rc        = Directory(InstDir)
  18. rc        = SysFileTree(InstDir||'\plugins','List','DO')
  19. if List.0    = 0 then rc = SysMkDir('Plugins')
  20.  
  21. rc        = SysFileTree(InstDir||'\plugins\sample.plg','List','FO')
  22. if List.0    = 1 then rc = SysFileDelete(InstDir||'\plugins\sample.plg')
  23. rc        = SysMoveObject(InstDir||'\sample.plg',InstDir||'\plugins')
  24.  
  25. rc        = SysFileTree(InstDir||'\plugins\length.plg','List','FO')
  26. if List.0    = 1 then rc = SysFileDelete(InstDir||'\plugins\length.plg')
  27. rc        = SysMoveObject(InstDir||'\length.plg',InstDir||'\plugins')
  28.  
  29.  
  30. /*********************************************************/
  31. /* Make changes to the "UnInstal.cmd" file               */
  32. /*********************************************************/
  33. UnInstValue    = CHARIN(UnInstall,1,CHARS(UnInstall))
  34. rc        = STREAM(UnInstall,'c','close')
  35.  
  36. NewInfo1    = "rc = sysini('USER', 'EE', 'Delete:')"||crlf
  37. NewInfo2    = "rc = sysini('USER', 'EEE', 'Delete:')"||crlf
  38. NewInfo        = NewInfo1||NewInfo2
  39.  
  40. Start        = POS('/* Other work    */', UnInstValue)
  41. UnInstValue    = INSERT(NewInfo,UnInstValue,start+20)
  42. rc        = SysFileDelete(UnInstall)
  43. rc        = CHAROUT(UnInstall,UnInstValue)
  44. rc        = STREAM(UnInstall,'c','close')
  45. rc        = Directory(ThisDir)
  46. rc        = SysFileDelete(InstDir||'\PrePlug.cmd')
  47. rc        = SysFileDelete(InstDir||'\PostPlug.cmd')
  48.