home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / csinst.zip / cpygreed.cmd next >
OS/2 REXX Batch file  |  1996-05-22  |  6KB  |  202 lines

  1. /* REXX *********************************************/
  2. /* Frame for your Rexx program. Verify please!      */
  3. /* Program name:                                    */
  4. /* Function    :                                    */
  5. /* Syntax      :                                    */
  6. /* Changes     :                                    */
  7. /*                                                  */
  8. /* Made use of GREED.  15 Mar 1996 / 10:58:16   JRK */
  9. /****************************************************/
  10. Parse Arg arg1, arg2
  11.  
  12. /*==============(Exception handling)================*/
  13. Signal On Failure Name CLEARUP
  14. Signal On Halt    Name CLEARUP
  15. Signal On Syntax  Name CLEARUP
  16.  
  17. /*==========(Initialize RexxUtil support)===========*/
  18. If RxFuncQuery('SysLoadFuncs') Then Do
  19.   Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  20.   Call SysLoadFuncs
  21. End /* If RxFuncQuery... */
  22.  
  23. destDir = CpyGreed()
  24.  
  25. /*================(End this program)================*/
  26. Exit
  27.  
  28. CLEARUP:
  29.   Say 'GREED001E - Break, Failure or Syntax Error'
  30. Exit
  31.  
  32. CpyGreed: Procedure
  33.  
  34. greedDir = "F:\DEVELOP\VISPROC\PROJECTS\GREED\"
  35. trg.1  = greedDir"GREED.FNC"
  36. trg.2  = greedDir"GREED.HLP"
  37. trg.3  = greedDir"GREED.ICO"
  38. trg.4  = greedDir"GREED.INF"
  39. trg.5  = greedDir"GREED.MSG"
  40. trg.6  = greedDir"GREEDX.FNC"
  41. trg.7  = greedDir"HTML.FNC"
  42. trg.8  = greedDir"GLOBAL.FNC"
  43. trg.9  = greedDir"TSOISPF.FNC"
  44. trg.10 = greedDir"RUN.EXE"
  45. trg.11  = greedDir"WAKuM.ICO"
  46. funwDir  = "F:\DEVELOP\VISPRORX\PROJECTS\INIWRITE\"
  47. trg.12 = funwDir"TemplEd.ICO"
  48. trg.13 = funwDir"RUN.EXE"
  49. brwseDir = "F:\DEVELOP\VISPROC\PROJECTS\BROWSEG\"
  50. trg.14 = brwseDir"PMBROWSE.ICO"
  51. trg.15 = brwseDir"PMBROWSE.HLP"
  52. trg.16 = brwseDir"RUN.EXE"
  53. ftpdDir = "F:\DEVELOP\VISPROC\PROJECTS\FTPDEF\"
  54. trg.17 = ftpdDir"FTPDEF.HLP"
  55. trg.18 = ftpdDir"FTPDEF.INF"
  56. trg.19 = ftpdDir"RUN.EXE"
  57. gtsDir ="F:\DEVELOP\VISPRORX\PROJECTS\GREEDX\"
  58. trg.20 = gtsDir"GREEDX.HLP"
  59. trg.21 = gtsDir"GREEDX.INF"
  60. trg.22 = gtsDir"GREEDX.ICO"
  61. trg.23 = gtsDir"RUN.EXE"
  62. insDir ="F:\DEVELOP\VISPRORX\PROJECTS\INSTALL\"
  63. trg.24 = insDir"INSTALL.ICO"
  64. trg.25 = insDir"CPYGREED.CMD"
  65. trg.26 = insDir"INSTALL.DOC"
  66. /*---(Installation program - not pack it!)---*/
  67. trg.27 = insDir"SAVEPRE.CMD"
  68. trg.28 = insDir"DELSAVES.CMD"
  69. trg.29 = insDir"RESTOREP.CMD"
  70. trg.30 = insDir"RUN.EXE"
  71. trg.31 = insDir"INSTALL.HLP"
  72. trg.32 = insDir"INSTALL.DAT"
  73. trg.0 = 32
  74.  
  75. tempDir = MadeDir("F:\NFNFUZIP\INSGREED\TEMP")
  76. If Datatype(tempDir) = 'NUM' Then Do 
  77.   Say 'Temporary directory not allocated. RC='tempDir
  78.   Return
  79. End
  80. Else Do
  81.   Say
  82.   Say tempDir
  83.   Call CharOut ,'Is it OK (y/n)? '
  84.   response = CharIn(,,1)
  85.   If Translate(response) \= 'Y' Then Return 1
  86. End 
  87. temp.1  = tempDir"\Greed.FNC"
  88. temp.2  = tempDir"\Greed.HLP"
  89. temp.3  = tempDir"\Greed.ICO"
  90. temp.4  = tempDir"\Greed.INF"
  91. temp.5  = tempDir"\Greed.MSG"
  92. temp.6  = tempDir"\GreedX.FNC"
  93. temp.7  = tempDir"\HTML.FNC"
  94. temp.8  = tempDir"\Global.FNC"
  95. temp.9  = tempDir"\TSOISPF.FNC"
  96. temp.10  = tempDir"\Greed.EXE"
  97. temp.11 = tempDir"\WAKuM.ICO"
  98. temp.12 = tempDir"\TemplEd.ICO"
  99. temp.13 = tempDir"\TemplEd.EXE"
  100. temp.14 = tempDir"\PMBROWSE.ICO"
  101. temp.15 = tempDir"\PMBROWSE.HLP"
  102. temp.16 = tempDir"\PMBROWSE.EXE"
  103. temp.17 = tempDir"\FtpDef.HLP"
  104. temp.18 = tempDir"\FtpDef.INF"
  105. temp.19 = tempDir"\FtpDef.EXE"
  106. temp.20 = tempDir"\GreedX.hlp"
  107. temp.21 = tempDir"\GreedX.Inf"
  108. temp.22 = tempDir"\GreedX.ICO"
  109. temp.23 = tempDir"\GreedX.EXE"
  110. temp.24 = tempDir"\INSTALL.ICO"
  111. temp.25 = tempDir"\CPYGREED.CMD"
  112. temp.26 = tempDir"\INSTALL.DOC"
  113. temp.27 = tempDir"\SAVEPRE.CMD"
  114. temp.28 = tempDir"\DELSAVES.CMD"
  115. temp.29 = tempDir"\RESTOREP.CMD"
  116. temp.30 = tempDir"\INSTALL.EXE"
  117. temp.31 = tempDir"\INSTALL.HLP"
  118. temp.32 = tempDir"\INSTALL.DAT"
  119.  
  120. temp.0 = trg.0 
  121.  
  122. do i = 1 to trg.0
  123.   "COPY" trg.i temp.i
  124.   If rc > 0 Then Return 1
  125. End
  126. /* "lxLite /y" tempDir"\*.exe" */
  127.  
  128. destDir = "F:\NFNFUZIP\INSGREED"
  129. dest.1  = destDir"\Greed.FN@"
  130. dest.2  = destDir"\Greed.HL@"
  131. dest.3  = destDir"\Greed.IC@"
  132. dest.4  = destDir"\Greed.IN@"
  133. dest.5  = destDir"\Greed.MS@"
  134. dest.6  = destDir"\GreedX.FN@"
  135. dest.7  = destDir"\HTML.FN@"
  136. dest.8  = destDir"\Global.FN@"
  137. dest.9  = destDir"\TSOISPF.FN@"
  138. dest.10 = destDir"\Greed.EX@"
  139. dest.11 = destDir"\WAKuM.IC@"
  140. dest.12 = destDir"\TemplEd.IC@"
  141. dest.13 = destDir"\TemplEd.EX@"
  142. dest.14 = destDir"\PMBROWSE.IC@"
  143. dest.15 = destDir"\PMBROWSE.HL@"
  144. dest.16 = destDir"\PMBROWSE.EX@"
  145. dest.17 = destDir"\FtpDef.HL@"
  146. dest.18 = destDir"\FtpDef.IN@"
  147. dest.19 = destDir"\FtpDef.EX@"
  148. dest.20 = destDir"\GreedX.HL@"
  149. dest.21 = destDir"\GreedX.IN@"
  150. dest.22 = destDir"\GreedX.IC@"
  151. dest.23 = destDir"\GreedX.EX@"
  152. dest.24 = destDir"\INSTALL.IC@"
  153. dest.25 = destDir"\CPYGREED.CM@"
  154. dest.26 = destDir"\INSTALL.DO@"
  155. /*---(Installation program - not pack it!)---*/
  156. dest.27 = destDir"\SAVEPRE.CMD"
  157. dest.28 = destDir"\DELSAVES.CMD"
  158. dest.29 = destDir"\RESTOREP.CMD"
  159. dest.30 = destDir"\INSTALL.EXE"
  160. dest.31 = destDir"\INSTALL.HLP"
  161. dest.32 = destDir"\INSTALL.DAT"
  162.  
  163. dest.0 = temp.0
  164.  
  165. /* PACK is a part of CSET++. If you not have it,   */
  166. /* use COPY instead of PACK. It haven't any affect */ 
  167. /* for Install-Routine!                            */
  168. do i = 1 to temp.0 - 6
  169.   "PACK" temp.i dest.i
  170.   If rc > 0 Then Return 1
  171. End
  172.  
  173. /*---(Installation program - not pack it!)---*/
  174. do i = temp.0 - 5 to temp.0 
  175.   "COPY" temp.i dest.i
  176.   If rc > 0 Then Return 1
  177. End
  178.  
  179. "DEL" tempDir"\*.*"
  180. "RD" tempDir
  181.  
  182. Return destDir
  183.  
  184. /*+++++++++++++++++++++++++++++++++++++++++++*/
  185. MadeDir: Procedure 
  186.  
  187. Arg dest_path
  188.  
  189. dest_path = Strip(dest_path,,'\')
  190. rc = SysFileTree( dest_path, fileList, 'DO' )
  191. If fileList.0 = 0 Then Do
  192.   Parse Var dest_path new_path '\' rest 
  193.   Do Until rest = '' 
  194.     Parse Var rest qf '\' rest
  195.     new_path = new_path||'\'||qf
  196.     rc = SysMkDir( new_path )
  197.     If rc > 0 & rc \= 5 Then Return rc
  198.   End
  199. End
  200.  
  201. Return dest_path
  202.