home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / pms_124.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1998-06-05  |  2KB  |  83 lines

  1. /* REXX file to install the PMStripper on the deskop     */
  2. /* if you use this script as a starting point for your   */
  3. /* own install script and make improvements, please send */
  4. /* me a copy ---  dwhawk@southwind.net                   */
  5.  
  6. call rxfuncadd 'sysloadfuncs', 'rexxutil', 'sysloadfuncs'
  7. call sysloadfuncs                /* register system functions */
  8. address cmd '@echo off'          /* echo is turned off */
  9.  
  10. call SysCLS
  11.  
  12. say "PMStripper installation"
  13. say "Enter destination drive and directory"
  14. say "for example C:\OS2\APPS"
  15. say "to install in the curent directory just press enter"
  16.  
  17. pull dest
  18. call setup_dir(dest) 
  19. call copy_files
  20. call MKOBJ
  21. exit
  22.  
  23. check_ok:
  24.   say  'Okay to continue(y/N) ? '        
  25.   k = SysGetKey('NOECHO') 
  26.   if k = 'Y' | k = 'y'  then return
  27.   say 'halting'
  28.     exit
  29.  
  30.  
  31. mkdir:  /* Procedure for creating dir */
  32.   Parse Arg dir
  33.   rc = SysMkDir(dir)
  34.   If (rc = 0 | rc = 5) Then Return
  35.   Say 'Problem creating destination directory "'dir'"'
  36.   Exit
  37.  
  38.  
  39. MKOBJ:
  40. Settings = 'EXENAME='direct||'\PMStrip.exe;'
  41. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  42. Settings = Settings||'CCVIEW=YES;'
  43. Settings = Settings||'STARTUPDIR='||direct';'
  44. Settings = Settings||'ASSOCFILTER=*.HTM,*.HTML;'
  45. rc=SysCreateObject('WPProgram','PMStripper','<WP_DESKTOP>',Settings,'R');
  46.  
  47. if rc = 1 then Say "PMStripper installed on desktop"
  48. return
  49.  
  50. setup_dir:      /* accept install path and create it if needed */
  51.                 /* the desired install path is in ARG(1) */
  52.                 /* if no path is specified current directory is used*/
  53.  
  54. Parse Arg destin  /* parameter of setup_dir */
  55.  
  56. save_dest = destin    /*  save original destin to */
  57.                       /*  determine if copy needed */
  58.  
  59. If destin = "" Then destin = Directory()
  60.  
  61. Say "Shall I install in "destin" ?"
  62. Call Check_Ok  /* your check routine */
  63.  
  64. Parse Var destin direct ':\' destin   /* get drive name only */
  65. direct=direct':'
  66.  
  67. Do Until destin = ""     /* No matter how many sub dirs present */
  68.   Parse Var destin sub '\' destin
  69.   direct=direct'\'sub
  70.   Call mkdir direct
  71. End
  72. return
  73.  
  74. copy_files:
  75. if save_dest \= ""  then do
  76.    'COPY PMStrip.doc ' direct
  77.    'COPY PMStrip.EXE ' direct
  78.    'COPY _order.frm ' direct
  79.    'COPY license.txt ' direct
  80.    'COPY tips ' direct
  81. end
  82. return
  83.