home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / nlok224.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-05-06  |  2KB  |  88 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 "NetLookout installation"
  13. say "Enter destination drive and directory"
  14. say "for example C:\NETLOOK"
  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||'\netlook.exe;'
  41. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  42. Settings = Settings||'CCVIEW=YES;'
  43. Settings = Settings||'STARTUPDIR='||direct';'
  44. rc=SysCreateObject('WPProgram','NetLookout','<WP_DESKTOP>',Settings,'R');
  45.  
  46. if rc = 1 then Say "NetLookout installed on desktop"
  47. return
  48.  
  49. setup_dir:      /* accept install path and create it if needed */
  50.                 /* the desired install path is in ARG(1) */
  51.                 /* if no path is specified current directory is used*/
  52.  
  53. Parse Arg destin  /* parameter of setup_dir */
  54.  
  55. save_dest = destin    /*  save original destin to */
  56.                       /*  determine if copy needed */
  57.  
  58. If destin = "" Then destin = Directory()
  59.  
  60. Say "Shall I install in "destin" ?"
  61. Call Check_Ok  /* your check routine */
  62.  
  63. Parse Var destin direct ':\' destin   /* get drive name only */
  64. direct=direct':'
  65.  
  66. Do Until destin = ""     /* No matter how many sub dirs present */
  67.   Parse Var destin sub '\' destin
  68.   direct=direct'\'sub
  69.   Call mkdir direct
  70. End
  71. return
  72.  
  73. copy_files:
  74. if save_dest \= ""  then do
  75.    'COPY netlook.exe' direct
  76.    'COPY netlook.hlp' direct
  77.    'COPY frugrsrc.dll' direct
  78.    'COPY frugm30.dll' direct
  79.    'COPY frugob3.dll' direct
  80.    'COPY frugod3.dll' direct
  81.    'COPY frugou3.dll' direct
  82.    'COPY readme.txt' direct
  83.    'COPY register.txt' direct
  84.  
  85. end
  86. return
  87.  
  88.