home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sfx.zip / Sample2.cmd < prev    next >
OS/2 REXX Batch file  |  2000-01-13  |  2KB  |  53 lines

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