home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / chgct21a.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1996-01-19  |  9KB  |  276 lines

  1. /************************************************************
  2. Change Controls Installation Program 2.1
  3. *************************************************************/
  4. '@echo off'
  5. 'ansi on'
  6. 'cls'
  7. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  8. call SysLoadFuncs
  9. call startups 'Checking files in directory'
  10. say'Checking for files...'
  11. call check 'BUTTONS.BMP'
  12. call check 'chg_ctls.cmd'
  13. call check 'chg_pm.exe'
  14. call check 'chg_pm.HLP'
  15. call check 'chg_pm.INF'
  16. call check 'ctls.RC'
  17. call check 'ctls.RES'
  18. call check 'down.bmp'
  19. call check 'down_d.bmp'
  20. call check 'down_g.bmp'
  21. call check 'HIDE_D.BMP'
  22. call check 'HIDE_U.BMP'
  23. call check 'left.bmp'
  24. call check 'left_d.bmp'
  25. call check 'left_g.bmp'
  26. call check 'list.BMP'
  27. call check 'logos.zip'
  28. call check 'maxi_d.bmp'
  29. call check 'maxi_up.bmp'
  30. call check 'max_d.BMP'
  31. call check 'max_u.bmp'
  32. call check 'min_d.bmp'
  33. call check 'min_up.BMP'
  34. call check 'motif.zip'
  35. call check 'npswpscb.bmp'
  36. call check 'npswpscb.txt'
  37. call check 'rdc.cmd'
  38. call check 'rdcpp.exe'
  39. call check 'readme.cmd'
  40. call check 'REBUILD.CMD'
  41. call check 'resmgr.cmd'
  42. call check 'RESMGR.ZIP'
  43. call check 'right.bmp'
  44. call check 'right_d.bmp'
  45. call check 'right_g.bmp'
  46. call check 'source.zip'
  47. call check 'swap_dll.exe'
  48. call check 'swap_dll.txt'
  49. call check 'sys_d_l.bmp'
  50. call check 'sys_d_s.bmp'
  51. call check 'sys_u_l.bmp'
  52. call check 'sys_u_s.bmp'
  53. call check 'up.bmp'
  54. call check 'up_d.bmp'
  55. call check 'up_g.bmp'
  56. say 'All files found.'
  57. '@pause'
  58. call startups ' '
  59. say 'You will need about 2.1 megs available space to run Change Controls'
  60. say 'Hit [ENTER] to Install Change Controls. [Control-C to Abort]'
  61. say ''
  62. pull dummy .
  63. say ''
  64. instdir='C:\chg_ctls'
  65. exename='chg_pm.exe'
  66. call startups 'Installation directory'
  67. say 'The default installation directory for Change Controls is ' instdir
  68. say 'Did you want to install to another directory? [N]'
  69. parse upper pull dummy
  70. if dummy = 'Y' then do
  71. say 'Enter your new installation path :'
  72. parse upper pull instdir
  73. end
  74. call checkdir instdir
  75. say ''
  76. call startups 'Installing files...'
  77. say 'Copying files...'
  78. 'copy BUTTONS.BMP' instdir
  79. 'copy chg_ctls.cmd' instdir
  80. 'copy chg_pm.exe'  instdir
  81. 'copy chg_pm.HLP'  instdir
  82. 'copy chg_pm.INF'  instdir
  83. 'copy ctls.RC'     instdir
  84. 'copy ctls.RES'    instdir
  85. 'copy down.bmp'    instdir
  86. 'copy down_d.bmp'  instdir
  87. 'copy down_g.bmp'  instdir
  88. 'copy HIDE_D.BMP'  instdir
  89. 'copy HIDE_U.BMP'  instdir
  90. 'copy left.bmp'    instdir
  91. 'copy left_d.bmp'  instdir
  92. 'copy left_g.bmp'  instdir
  93. 'copy list.BMP'    instdir
  94. 'copy logos.zip'   instdir
  95. 'copy maxi_d.bmp'  instdir
  96. 'copy maxi_up.bmp' instdir
  97. 'copy max_d.BMP'   instdir
  98. 'copy max_u.bmp'   instdir
  99. 'copy min_d.bmp'   instdir
  100. 'copy min_up.BMP'  instdir
  101. 'copy motif.zip'   instdir
  102. 'copy npswpscb.bmp' instdir
  103. 'copy npswpscb.txt' instdir
  104. 'copy rdc.cmd'     instdir
  105. 'copy rdcpp.exe'     instdir
  106. 'copy readme.cmd'  instdir
  107. 'copy REBUILD.CMD' instdir
  108. 'copy resmgr.cmd'  instdir
  109. 'copy RESMGR.ZIP'  instdir
  110. 'copy right.bmp'   instdir
  111. 'copy right_d.bmp' instdir
  112. 'copy right_g.bmp' instdir
  113. 'copy source.zip'  instdir
  114. 'copy swap_dll.exe' instdir
  115. 'copy swap_dll.txt' instdir
  116. 'copy sys_d_l.bmp' instdir
  117. 'copy sys_d_s.bmp' instdir
  118. 'copy sys_u_l.bmp' instdir
  119. 'copy sys_u_s.bmp' instdir
  120. 'copy up.bmp'      instdir
  121. 'copy up_d.bmp'    instdir
  122. 'copy up_g.bmp'    instdir
  123. say 'Done Copying.'
  124. '@pause'
  125. dlldir='C:\os2\dll'
  126. call startups 'Looking for pmmerge.dll'
  127. say 'Is your OS2 dll Directory [ c:\os2\dll ]? [Y]:'
  128. parse upper pull dummy
  129. if dummy = 'N' then do
  130. say 'Enter your OS2 dll Directory:'
  131. parse upper pull dlldir
  132. end
  133. call checkdir dlldir
  134. say ''
  135. say 'making a backup copy of pmmerge.dll called pmmerge.bak'
  136. 'copy 'dlldir'\pmmerge.dll' dlldir'\pmmerge.bak'
  137. say 'Copying pmmerge.dll ...'
  138. 'copy 'dlldir'\pmmerge.dll' instdir
  139. cfgsys='c:'
  140. call startups 'Adding Swap Dll Utility to config.sys'
  141. say 'Automatically add the Swap Dll utility to your config.sys?[N]:'
  142. parse upper pull dummy
  143. if dummy = 'Y' then do
  144. say 'What drive is OS2 installed on?'
  145. say '(Must have colon after drive letter example-> c: ): '
  146. parse upper pull cfgsys
  147. say 'making a backup of config.sys called config.chg...'
  148. 'copy ' cfgsys'\config.sys' cfgsys'\config.chg'
  149. say 'adding swap dll utility to your config.sys...'
  150. call lineout cfgsys'\config.sys','call='instdir'\swap_dll.exe /c'cfgsys'\os2\cmd.exe /s'instdir' /d'dlldir' /w5'
  151. '@pause'
  152. end
  153. call startups 'Creating WPS Objects'
  154. call SysDestroyObject('<chg_Folder>')
  155. say "Creating a folder for Change Controls..."
  156. title = "Change Controls"
  157. classname = 'WPFolder'
  158. location = '<WP_DESKTOP>'
  159. setup = 'OBJECTID=<chg_Folder>;OPEN=DEFAULT'
  160. call SysCreateObject classname,title,location,setup,f
  161. say 'Creating the program and readme objects...'
  162. title = "Change Controls 2.1"
  163. classname = 'WPProgram'
  164. location = '<chg_Folder>'
  165. setup = 'EXENAME='instdir'\'exename';PARAMETERS=%*;STARTUPDIR='instdir
  166. call SysCreateObject classname,title,location,setup,u
  167.  
  168. title = "Readme for Change Controls"
  169. classname = 'WPProgram'
  170. location = '<chg_Folder>'
  171. setup = 'EXENAME='instdir'\readme.cmd;PARAMETERS=%*;STARTUPDIR='instdir
  172. call SysCreateObject classname,title,location,setup,u
  173.  
  174. say 'Finished Installing Change Controls.'
  175. say 'Starting the Viewer on Help file'
  176. say 'Some last minute changes to the help file:'
  177. say ' '
  178. say 'You no longer need to manually copy pmmerge.dll into the install directory'
  179. say 'Also, the swap_dll.exe utility was automatically added to your config.sys'
  180. say 'if you allowed this install program to do it.'
  181. say 'If you have schemes that you have already drawn for an earlier version of'
  182. say 'Change Controls, you should make a backup copy of them before installing'
  183. say 'this version.'
  184. say ''
  185. say 'If you run the install program, you no longer need to manually add'
  186. say 'the swap dll program to your config.sys'
  187. say''
  188. say'Make sure to make a backup copy of pmmerge.dll before installing.'
  189. say'I can also be reached at matt.schellhaas@churchey.os2bbs.com if my other e-mail'
  190. say'address has problems.'    
  191. '@pause'
  192. 'view chg_pm'
  193. exit
  194.  
  195. check: procedure
  196.  
  197. rc = stream(ARG(1),'c','query exists')
  198. if rc = '' then
  199. do
  200.   call startups '!!!!!!!!!! ERROR !!!!!!!!!!'
  201.   say 'The file 'ARG(1)' was not found.'
  202.   say 'This program must be run from the directory where you unpacked the archive.'
  203.   '@pause'
  204.   exit
  205. end
  206. return
  207.  
  208. check2: procedure
  209.  
  210. rc = stream(instdir'\'ARG(1),'c','query exists')
  211. if rc = '' then
  212. do
  213.   call startups '!!!!!!!!!! ERROR !!!!!!!!!!'
  214.   say 'The file 'ARG(1)' was not correctly copied.'
  215.   say 'Not a huge problem, but you will have to manually copy'
  216.   say 'pmmerge.dll into the install directory before running Change Controls'
  217.   '@pause'
  218. end
  219. if rc <> '' then
  220. do
  221.   say '--Last minute correction to the Installation Instructions in the manual--'
  222.   say 'You no longer need to manually copy pmmerge.dll'
  223.   '@pause'
  224. end
  225. return
  226.  
  227.  
  228. checkdir: procedure
  229. parse upper arg DIR;
  230. curdir=directory()
  231. tstdir=directory(DIR);
  232. if tstdir\=DIR then
  233. do
  234. 'mkdir 'DIR
  235. end
  236. tstdir=directory(DIR);
  237. if tstdir\=DIR then
  238. do
  239.  
  240.  call startups '!!!!!!!!!! ERROR !!!!!!!!!!'
  241.  say 'You specified an invalid path.'
  242.  say tstdir ' -' DIR
  243.  say 'Run the installation program again after this problem is fixed.'
  244.  tstdir=directory(curdir)
  245. '@pause'
  246.  exit
  247.  
  248. end
  249. tstdir=directory(curdir)
  250. return
  251.  
  252.  
  253. startups: procedure
  254. call SysCls
  255. say'┌────────────────────────────────────────────────────────────────────────────┐'
  256. say'│  ▄█▀▄█ ▀██C▄C│'
  257. say'│ ▐█▌  █  ██ ▄▄    ▄▄▄   ▄ ▄▄▄    ▄▄▄▀    ▄▄▄C│'
  258. say'│ ██C██▀ ██  ▀▀▄██   ██ ██  ██ ██  ▄██ ██C│'
  259. say'│ ▐█▌C██  ██  ▄█ ██   ██ ██  ▀█▄█▀  ██▀▀▀▀C│'
  260. say'│  ▀█▄▄▀ ▄██  ██▄ ▀█▄▀▀▄ ▄██ ██▄  ▄▀██▄  ▀█▄▄▀C│'
  261. say'│C██  ██C│'
  262. say'│C▀██▄█▀C(C)1995 Matt Schellhaas │'
  263. say'│  ▄█▀▄█C▄C▀██C│'
  264. say'│ ▐█▌  █  ▄▄▄  ▄ ▄▄▄    ██   ▄ ▄▄▄   ▄▄▄   ██   ▄▄▄C│'
  265. say'│ ██C██ ██  ██ ██  ▀██▀   ██ ██ ██ ██  ██  ▀██▄C│'
  266. say'│ ▐█▌    ██ ██  ██ ██   ██    ██    ██ ██  ██    ▀██C│'
  267. say'│  ▀█▄▄▀ ▀█▄█▀ ▄██ ██▄  ▀█▄▀ ▄██    ▀█▄█▀ ▄██▄ ▀▄▄█▀C│'
  268. say'│C│'
  269. say'│CInstallationC│'
  270. say'└────────────────────────────────────────────────────────────────────────────┘'
  271. say''
  272. say'     'ARG(1)
  273. say ''
  274. return
  275.  
  276.