home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / qnq_100.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-08-03  |  3KB  |  105 lines

  1. /* REXX file to install Don's Quips n Quotes 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 "Don's Quips n Quotes 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.   end
  30.  
  31.  
  32. mkdir:  /* Procedure for creating dir */
  33.   Parse Arg dir
  34.   rc = SysMkDir(dir)
  35.   If (rc = 0 | rc = 5) Then Return
  36.   Say 'Problem creating destination directory "'dir'"'
  37.   Exit
  38.  
  39.  
  40. MKOBJ:
  41. Settings = 'EXENAME='direct||'\qnq_pm.exe;'
  42. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  43. Settings = Settings||'ICONFILE='direct||'\Cookie.ICO;'
  44. Settings = Settings||'CCVIEW=YES;'
  45. Settings = Settings||'STARTUPDIR='||direct';'
  46. Settings = Settings||'PARAMETERS=wisdom.dat;'
  47. rc=SysCreateObject('WPProgram','wisdom','<WP_DESKTOP>',Settings,'R');
  48.  
  49. if rc = 1 then Say "Quips N Qoutes wisdom installed on desktop"
  50.  
  51. Settings = 'EXENAME='direct||'\qnq_pm.exe;'
  52. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  53. Settings = Settings||'ICONFILE='direct||'\Cookie.ICO;'
  54. Settings = Settings||'CCVIEW=YES;'
  55. Settings = Settings||'STARTUPDIR='||direct';'
  56. Settings = Settings||'PARAMETERS=taglines.dat;'
  57. rc=SysCreateObject('WPProgram','taglines','<WP_DESKTOP>',Settings,'R');
  58.  
  59. if rc = 1 then Say "Quips N Qoutes taglines installed on desktop"
  60.  
  61. Settings = 'EXENAME='direct||'\qnq_pm.exe;'
  62. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  63. Settings = Settings||'ICONFILE='direct||'\Cookie.ICO;'
  64. Settings = Settings||'CCVIEW=YES;'
  65. Settings = Settings||'STARTUPDIR='||direct';'
  66. Settings = Settings||'PARAMETERS=quotes.dat;'
  67. rc=SysCreateObject('WPProgram','quotes','<WP_DESKTOP>',Settings,'R');
  68.  
  69. if rc = 1 then Say "Quips N Qoutes quotes installed on desktop"
  70. return
  71. end
  72.  
  73. setup_dir:      /* accept install path and create it if needed */
  74.                 /* the desired install path is in ARG(1) */
  75.                 /* if no path is specified current directory is used*/
  76.  
  77. Parse Arg destin  /* parameter of setup_dir */
  78.  
  79. save_dest = destin    /*  save original destin to */
  80.                       /*  determine if copy needed */
  81.  
  82. If destin = "" Then destin = Directory()
  83.  
  84. Say "Shall I install in "destin" ?"
  85. Call Check_Ok  /* your check routine */
  86.  
  87. Parse Var destin direct ':\' destin   /* get drive name only */
  88. direct=direct':'
  89.  
  90. Do Until destin = ""     /* No matter how many sub dirs present */
  91.   Parse Var destin sub '\' destin
  92.   direct=direct'\'sub
  93.   Call mkdir direct
  94. End
  95. return
  96.  
  97. copy_files:
  98. if save_dest \= ""  then do
  99.    'COPY qnq_pm.exe' direct
  100.    'COPY cookie.ico' direct
  101.    'COPY *.dat' direct
  102. end
  103. return
  104. end
  105.