home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / pbxs_200.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-10-11  |  2KB  |  87 lines

  1. /* REXX file to install the Pastry Box 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 "Pastry Box 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||'\Pastry.exe;'
  42. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  43. Settings = Settings||'ICONFILE='direct||'\Pastry.ICO;'
  44. Settings = Settings||'CCVIEW=YES;'
  45. Settings = Settings||'STARTUPDIR='||direct';'
  46. rc=SysCreateObject('WPProgram','Pastry Box','<WP_DESKTOP>',Settings,'R');
  47.  
  48. if rc = 1 then Say "Pastry Box installed on desktop"
  49. return
  50. end
  51.  
  52. setup_dir:      /* accept install path and create it if needed */
  53.                 /* the desired install path is in ARG(1) */
  54.                 /* if no path is specified current directory is used*/
  55.  
  56. Parse Arg destin  /* parameter of setup_dir */
  57.  
  58. save_dest = destin    /*  save original destin to */
  59.                       /*  determine if copy needed */
  60.  
  61. If destin = "" Then destin = Directory()
  62.  
  63. Say "Shall I install in "destin" ?"
  64. Call Check_Ok  /* your check routine */
  65.  
  66. Parse Var destin direct ':\' destin   /* get drive name only */
  67. direct=direct':'
  68.  
  69. Do Until destin = ""     /* No matter how many sub dirs present */
  70.   Parse Var destin sub '\' destin
  71.   direct=direct'\'sub
  72.   Call mkdir direct
  73. End
  74. return
  75.  
  76. copy_files:
  77. if save_dest \= ""  then do
  78.    'COPY LICENSE.TXT ' direct
  79.    'COPY ORDER.BMT   ' direct
  80.    'COPY PASTRY.EXE  ' direct
  81.    'COPY PASTRY.ICO  ' direct
  82.    'COPY PASTRY2.DOC ' direct
  83.    'COPY READ.ME     ' direct
  84. end
  85. return
  86. end
  87.