home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / pms_126.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  2002-06-07  |  3KB  |  108 lines

  1. /* REXX file to install PMStripper on the desktop     */
  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@intcon.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. /*
  20. say " "
  21. say "Enter CPU version to install"
  22. say "Enter 3 for 386 version"
  23. say "Enter 4 for 486 version"
  24. say "Enter 5 for 586/686/Pentium version"
  25.  
  26. pull version
  27. */
  28. call copy_files
  29. call MKOBJ
  30. exit
  31.  
  32. check_ok:
  33.   say  'Okay to continue(Y/N) ? '        
  34.   k = SysGetKey('NOECHO') 
  35.   if k = 'Y' | k = 'y'  then return
  36.   say 'halting'
  37.     exit
  38.  
  39.  
  40. mkdir:  /* Procedure for creating dir */
  41.   Parse Arg dir
  42.   rc = SysMkDir(dir)
  43.   If (rc = 0 | rc = 5) Then Return
  44.   Say 'Problem creating destination directory "'dir'"'
  45.   Exit
  46.  
  47.  
  48. MKOBJ:
  49. Settings = 'EXENAME='direct||'\pmstrip.exe;'
  50. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO'
  51. Settings = Settings||'CCVIEW=YES;'
  52. Settings = Settings||'ASSOCFILTER=*.HTM,*.HTML;'
  53. Settings = Settings||'STARTUPDIR='||direct';'
  54. rc=SysCreateObject('WPProgram','PMStripper','<WP_DESKTOP>',Settings,'R');
  55.  
  56. if rc = 1 then Say "PMStripper installed on desktop"
  57. return
  58.  
  59. setup_dir:      /* accept install path and create it if needed */
  60.                 /* the desired install path is in ARG(1) */
  61.                 /* if no path is specified current directory is used*/
  62.  
  63. Parse Arg destin  /* parameter of setup_dir */
  64.  
  65. save_dest = destin    /*  save original destin to */
  66.                       /*  determine if copy needed */
  67.  
  68. If destin = "" Then destin = Directory()
  69.  
  70. Say "Shall I install in "destin" ?"
  71. Call Check_Ok  /* your check routine */
  72.  
  73. Parse Var destin direct ':\' destin   /* get drive name only */
  74. direct=direct':'
  75.  
  76. Do Until destin = ""     /* No matter how many sub dirs present */
  77.   Parse Var destin sub '\' destin
  78.   direct=direct'\'sub
  79.   Call mkdir direct
  80. End
  81. return
  82.  
  83. copy_files:
  84. /*
  85. if version = "5" then do
  86.    'COPY pms5.exe pmstrip.exe'
  87. end     
  88. if version = "4" then do
  89.    'COPY pms4.exe pmstrip.exe'
  90. end     
  91. if version = "3" then do
  92.    'COPY pms3.exe pmstrip.exe'
  93. end     
  94. */ 
  95.  
  96. if save_dest \= ""  then do
  97.    'COPY pmstrip.doc' direct
  98.    'COPY pmstrip.exe' direct  
  99.    'COPY LICENSE.TXT' direct
  100.    'COPY readme.1st' direct
  101.    'COPY tips' direct
  102.    'COPY viewer.txt' direct
  103.    'COPY whats.new' direct
  104.    'COPY _order.frm' direct
  105. end
  106. return
  107.  
  108.