home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / dhg_106a.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1999-03-03  |  3KB  |  112 lines

  1. /* REXX file to install the DH-Grep-PM 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@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 "DH-Grep-PM 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 "Select regular or large font version of the online help"
  22. say "Enter R for regular font version"
  23. say "Enter L for large font version"
  24. pull helpFont
  25. say "You have entered "helpFont" for the help file version to install"
  26. Call Check_Ok  /* your check routine */
  27.  
  28.  
  29. call copy_files
  30. call MKOBJ
  31. exit
  32.  
  33. check_ok:
  34.   say  'Okay to continue(Y/n) ? '        
  35.   k = SysGetKey('NOECHO') 
  36.   if k = 'Y' | k = 'y'  then return
  37.   say 'halting'
  38.     exit
  39.  
  40.  
  41. mkdir:  /* Procedure for creating dir */
  42.   Parse Arg dir
  43.   rc = SysMkDir(dir)
  44.   If (rc = 0 | rc = 5) Then Return
  45.   Say 'Problem creating destination directory "'dir'"'
  46.   Exit
  47.  
  48.  
  49. MKOBJ:
  50. Settings = 'EXENAME='direct||'\dhgrep-s.exe;'
  51. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  52. Settings = Settings||'CCVIEW=YES;'
  53. Settings = Settings||'STARTUPDIR='||direct';'
  54. rc=SysCreateObject('WPProgram','DH-Grep-PM','<WP_DESKTOP>',Settings,'R');
  55.  
  56. if rc = 1 then Say "DH-Grep-PM 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 helpFont = "L" then do
  86.       'COPY dhg_lrg.hlp dhgreppm.hlp'
  87.    end
  88.    if helpFont = "R" then do
  89.       'COPY dhg_reg.hlp dhgreppm.hlp'
  90.    end
  91.  
  92. if save_dest \= ""  then do
  93.    'COPY dhgrep-s.exe' direct
  94.    'COPY dhgreppm.hlp' direct
  95.  
  96.    if helpFont = "L" then do
  97.       'COPY dhg_lrg.hlp dhgreppm.hlp'
  98.       'COPY dhgreppm.hlp' direct
  99.    end
  100.    if helpFont = "R" then do
  101.       'COPY dhg_reg.hlp dhgreppm.hlp'
  102.       'COPY dhgreppm.hlp' direct
  103.    end
  104.  
  105.    'COPY dhgreppm.doc' direct
  106.    'COPY edit_cmd.cmd' direct
  107.    'COPY _order.frm' direct
  108.    'COPY license.txt' direct
  109.  
  110. end
  111. return
  112.