home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / rbisfv10.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-06-28  |  7KB  |  246 lines

  1. /* rexx - install.cmd - install rlgbisf 6/28/98            */
  2. /* usage: INSTALL x:\install_directory dos_drive os2_drive */
  3.  
  4. if Stream('rlgBISF.EXE','C','Query Exists') = '' then do
  5.     say 'Please run this program from the same directory as the rlgBISF.EXE file'
  6.     say ''
  7.     say 'Exiting . . .'
  8.     exit
  9. end
  10.  
  11. parse upper arg install_dir dos_drive os2_drive
  12. parse value install_dir with install_drive ':' install_dir
  13. if install_drive = '' then
  14.     install_drive = 'E'
  15. if install_dir = '' then
  16.     install_dir = '\rlgBISF'
  17. install_drive = LEFT(install_drive,1)
  18. install_dir = STRIP(install_dir)
  19. if RIGHT(install_dir,1) = '\' then
  20.     install_dir = STRIP(install_dir,'T','\')
  21. if install_dir = '' then
  22.     install_dir = '\'
  23. dos_drive = LEFT(dos_drive,1)
  24. os2_drive = LEFT(os2_drive,1)
  25. if dos_drive = '' then
  26.     dos_drive = 'C'
  27. if os2_drive = '' then
  28.     os2_drive = 'E'
  29.  
  30. say 'rlgBISF v1.0 will be installed in 'install_drive':'install_dir
  31. say ''
  32. say '   DOS  is installed on drive 'dos_drive':'
  33. say '   OS/2 is installed on drive 'os2_drive':'
  34. say ''
  35. say 'Is this correct? (y/N):'
  36. parse upper pull answer
  37. if answer = 'Y' then
  38.     nop
  39. else do
  40.     call usage
  41.     exit
  42. end
  43. /******************************/
  44. /* OK, begin installation     */
  45. /******************************/
  46. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  47. Call SysLoadFuncs
  48. say ''
  49. Call SysMkDir install_drive':'install_dir
  50. rlgBISF_install_dir = install_drive':'install_dir
  51. Program = 'rlgBISF'
  52. File.0  = 10
  53. File.1  = 'BISFhlp.txt'
  54. File.2  = 'FILE_ID.DIZ'
  55. File.3  = 'FILES.LST'
  56. File.4  = 'install.cmd'
  57. File.5  = 'readme.txt'
  58. File.6  = 'register.txt'
  59. File.7  = 'rlgBISF.exe'
  60. File.8  = 'rlgBISF.ico'
  61. File.9  = 'uninstal.cmd'
  62. File.10 = 'vrobjdll.url'
  63. ADDRESS CMD
  64. "@echo off"
  65. say 'Copying files to 'rlgBISF_install_dir
  66. do i = 1 to File.0
  67.     "copy "File.i" "rlgBISF_install_dir
  68. end
  69. ADDRESS
  70. if install_dir = '\' then
  71.     rlgBISF_install_dir = install_drive':'
  72. rlgbisf_ini = rlgBISF_install_dir'\rlgBISF.INI'
  73.  
  74. /* delete all previous settings for rlgbisf from os2.ini */
  75. /* say 'Adding entry to OS2.INI' */
  76. call SysIni , Program
  77. /* add rlgBISF settings to OS2.INI */
  78. rc = SysIni('USER', Program, 'rlgBISF_install_dir', rlgBISF_install_dir)
  79. if rc \= '' then do
  80.     say 'Error setting installation directory in OS2.INI.   Exiting.'
  81.     exit
  82. end
  83. /* say 'Adding entries to 'rlgbisf_ini */
  84. rc = SysIni(rlgbisf_ini, 'rlgBISF', 'rlgBISF_dos_drive', dos_drive)
  85. if rc \= '' then do
  86.     say 'Error setting dos_drive in 'rlgbisf_ini'.   Exiting.'
  87.     exit
  88. end
  89.  
  90. rc = SysIni(rlgbisf_ini, 'rlgBISF', 'rlgBISF_os2_drive', os2_drive)
  91. if rc \= '' then do
  92.     say 'Error setting os2_drive in 'rlgbisf_ini'.   Exiting.'
  93.     exit
  94. end
  95.  
  96. /* Create main folder object */
  97. /* say ''
  98.  * say 'Building Workplace Shell rlgBISF v1.0 Objects...'
  99.  * say ''
  100.  */
  101. /**********************/
  102. /** folder           **/
  103. /**********************/
  104. classname = 'WPFolder'
  105. title     = 'Backup Important^System Files v1.0'
  106. location  = '<WP_DESKTOP>'
  107. objectid  = '<rlgBISF_folder>'
  108. setup     = 'OBJECTID=' || objectid || ';'
  109. rc = SysCreateObject(classname, title, location, setup, 'r')
  110. if rc = 1 then
  111.     nop /*say '  folder object built'*/
  112. else do
  113.     say '  error building folder, rc = 'rc
  114.     exit
  115. end
  116.  
  117. /**********************/
  118. /** readme.txt       **/
  119. /**********************/
  120. classname = 'WPProgram'
  121. objectid  = '<rlgBISF_readme>'
  122. exename   = 'E.EXE'
  123. title     = 'Readme^First'
  124. location  = '<rlgBISF_folder>'
  125. setup     = 'OBJECTID=' || objectid || ';EXENAME=' || exename ||,
  126.             ';PARAMETERS=' || rlgBISF_install_dir || '\README.TXT' ||,
  127.             ';PROGTYPE=PM;'
  128. rc = SysCreateObject(classname, title, location, setup, 'r')
  129. if rc = 1 then
  130.     nop /*say '  readme object built'*/
  131. else do
  132.     say '  error building readme, rc = 'rc
  133.     exit
  134. end
  135.  
  136. /**********************/
  137. /** program          **/
  138. /**********************/
  139. classname = 'WPProgram'
  140. objectid  = '<rlgBISF_program>'
  141. exename   = rlgBISF_install_dir || '\RLGBISF.EXE'
  142. iconfile  = rlgBISF_install_dir || '\RLGBISF.ICO'
  143. title     = 'rlgBISF v1.0'
  144. location  = '<rlgBISF_folder>'
  145. setup     = 'OBJECTID=' || objectid || ';EXENAME=' || exename ||,
  146.             ';PROGTYPE=PM;ICONFILE=' || iconfile ||,
  147.             ';STARTUPDIR=' || rlgBISF_install_dir || ';'
  148. rc = SysCreateObject(classname, title, location, setup, 'r')
  149. if rc = 1 then
  150.     nop /*say '  program object built'*/
  151. else do
  152.     say '  error building program, rc = 'rc
  153.     exit
  154. end
  155.  
  156. /**********************/
  157. /** bisfhlp.txt      **/
  158. /**********************/
  159. classname = 'WPProgram'
  160. objectid  = '<rlgBISF_bisfhlp>'
  161. exename   = 'E.EXE'
  162. title     = 'rlgBISF^Help'
  163. location  = '<rlgBISF_folder>'
  164. setup     = 'OBJECTID=' || objectid || ';EXENAME=' || exename ||,
  165.             ';PARAMETERS=' || rlgBISF_install_dir || '\BISFHLP.TXT' ||,
  166.             ';PROGTYPE=PM;'
  167. rc = SysCreateObject(classname, title, location, setup, 'r')
  168. if rc = 1 then
  169.     nop /*say '  help object built'*/
  170. else do
  171.     say '  error building help, rc = 'rc
  172.     exit
  173. end
  174.  
  175. /**********************/
  176. /** register.txt     **/
  177. /**********************/
  178. classname = 'WPProgram'
  179. objectid  = '<rlgBISF_register>'
  180. exename   = 'E.EXE'
  181. title     = 'Registration^Form'
  182. location  = '<rlgBISF_folder>'
  183. setup     = 'OBJECTID=' || objectid || ';EXENAME=' || exename ||,
  184.             ';PARAMETERS=' || rlgBISF_install_dir || '\REGISTER.TXT' ||,
  185.             ';PROGTYPE=PM;'
  186. rc = SysCreateObject(classname, title, location, setup, 'r')
  187. if rc = 1 then
  188.     nop /*say '  registration form object built'*/
  189. else do
  190.     say '  error building registration form, rc = 'rc
  191.     exit
  192. end
  193.  
  194. /**********************/
  195. /** vrobjdll.url     **/
  196. /**********************/
  197. classname = 'WPProgram'
  198. objectid  = '<rlgBISF_vrobjdll>'
  199. exename   = 'E.EXE'
  200. title     = 'URL to download^VROBJ.DLL'
  201. location  = '<rlgBISF_folder>'
  202. setup     = 'OBJECTID=' || objectid || ';EXENAME=' || exename ||,
  203.             ';PARAMETERS=' || rlgBISF_install_dir || '\VROBJDLL.URL' ||,
  204.             ';PROGTYPE=PM;'
  205. rc = SysCreateObject(classname, title, location, setup, 'r')
  206. if rc = 1 then
  207.     nop /*say '  vrobjdll object built'*/
  208. else do
  209.     say '  error building vrobjdll, rc = 'rc
  210.     exit
  211. end
  212.  
  213. /**********************/
  214. /** shadow program   **/
  215. /** onto the desktop **/
  216. /**********************/
  217. classname = 'WPShadow'
  218. objectid  = '<rlgBISF_shadow_pgm>'
  219. shadowid  = '<rlgBISF_program>'
  220. title     = 'Backup Important^System Files'
  221. location  = '<WP_DESKTOP>'
  222. setup     = 'SHADOWID=' || shadowid || ';OBJECTID=' || objectid || ';'
  223. rc = SysCreateObject(classname, title, location, setup, 'r')
  224. if rc = 1 then
  225.     nop /*say '  desktop shadow object built'*/
  226. else do
  227.     say '  error building desktop shadow, rc = 'rc
  228.     exit
  229. end
  230. say 'rlgBISF v1.0 has been installed.'
  231. return
  232.  
  233. usage:
  234.     /* usage: INSTALL x:\install_directory dos_drive os2_drive */
  235.     say ''
  236.     say 'This program installs the various files and objects needed to run rlgBISF v1.0.'
  237.     say ''
  238.     say 'Usage:    install [target_drive:\target_dir] [dos_drive] [os2_drive]'
  239.     say ''
  240.     say 'Example:  install X:\rlgBISF Y Z'
  241.     say ''
  242.     say '  where X:\rlgBISF is the installation drive and directory,'
  243.     say '        Y          is the drive where DOS/Windows is installed,'
  244.     say '        Z          is the drive where OS/2 is installed.'
  245. return
  246.