home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 28 Fixes4x / 28-Fixes4x.zip / chkdsk.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1997-05-02  |  5KB  |  142 lines

  1. /*-------------------------------------------------------------------------*
  2.  * INSTALL     exec, started  2/07/97 by John Stiles, stiles@ausnotes
  3.  *    --> Install this thing...
  4.  *  Change Activity:
  5.  *-------------------------------------------------------------------------*
  6.  */
  7. os2_dir = '\os2'
  8. os2_dll_dir = '\os2\dll'
  9. os2_boot_dir = '\os2\boot'
  10. file_1 = 'chkdsk32.exe'
  11. file_2 = 'chkdsk32.dll'
  12. file_3 = 'uhpfs.dll'
  13. save_file_3 = 'uhpfs.sav'
  14. file_4 = 'chkdsk.sys'
  15.  
  16. /* Load REXXUTIL */
  17. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  18. call sysloadfuncs
  19.  
  20. /* Find out where INSTALL.CMD is located */
  21. Parse UPPER Source . . inst_fsp '\INSTALL.CMD'
  22.  
  23. /* Look for the boot drive */
  24. bootdrive = filespec('Drive', value('comspec',, 'os2environment'))
  25.  
  26. '@echo off '
  27. 'type 'inst_fsp||'\readme | more.com '
  28. say ' '
  29. say ' '
  30. say 'ChkDsk Service Fix install... '
  31. say ' '
  32. say 'The install program will install to your 'os2_dir' and 'os2_dll_dir' subdirectories. '
  33. say ' '
  34. say 'Three files will be copied to your system.  Two are new, and one is a '
  35. say ' replacement ('file_3').  The original 'file_3' will be copied to '
  36. say ' 'save_file_3' in case you wish to restore the original function or '
  37. say ' selectively run the Service Fix per instructions in the README. '
  38. say ' '
  39. say ' '
  40. say 'Press Y to continue install - any other response quits:  '
  41. Parse UPPER value SysGetKey('NOECHO') with key
  42. If key \= 'Y' Then do
  43.   say ' '
  44.   say 'Install ended at your request. '
  45.   Signal Quit_Pgm
  46. End
  47.  
  48. /* Let them select a drive... */
  49. say ' '
  50. say 'Code will be installed on your 'bootdrive' drive.  Press enter to accept, else '
  51. say ' type the letter of the drive you wish to install on: '
  52. Parse UPPER value SysGetKey('NOECHO') with key
  53. If key = '0D'x Then  sinkdrive = bootdrive
  54. Else do
  55.   If (length(key) \= 1 | Datatype(key, 'U') \= 1) Then do
  56.     say ' '
  57.     say key' is not a valid OS/2 drive letter. '
  58.     say 'Install failed due to bad drive letter. '
  59.     Signal Quit_Pgm
  60.   End
  61.   sinkdrive = key||':'
  62.   say ' '
  63.   say ' Installing to drive 'sinkdrive
  64. End
  65.  
  66. /* Look for directories...   */
  67. os2_fsp = sinkdrive||os2_dir
  68. os2_dll_fsp = sinkdrive||os2_dll_dir
  69. os2_boot_fsp = sinkdrive||os2_boot_dir
  70. here = stream(os2_fsp||'\chkdsk.com', 'C', 'query exists')
  71. If here = '' Then do
  72.   say ' '
  73.   say "Can't seem to find your "os2_fsp" directory. "
  74.   say 'This directory must be present for install to work properly. '
  75.   say 'Install failed due to missing subdirectory. '
  76.   Signal Quit_Pgm
  77. End
  78. here = stream(os2_dll_fsp||'\'||file_3, 'C', 'query exists')
  79. If here = '' Then do
  80.   say ' '
  81.   say "Can't seem to find your "os2_dll_dir" directory. "
  82.   say 'This directory must be present for install to work properly. '
  83.   say 'Install failed due to missing subdirectory. '
  84.   Signal Quit_Pgm
  85. End
  86. here = stream(os2_boot_fsp||'\ibmkbd.sys', 'C', 'query exists')
  87. If here = '' Then do
  88.   say ' '
  89.   say "Can't seem to find your "os2_boot_dir" directory. "
  90.   say 'This directory must be present for install to work properly. '
  91.   say 'Install failed due to missing subdirectory. '
  92.   Signal Quit_Pgm
  93. End
  94.  
  95. /* Check for disk space...   */
  96. drinfo = SysDriveInfo(sinkdrive)
  97. If drinfo = '' Then do
  98.   say ' '
  99.   say "Can't seem to find your "sinkdrive" drive. "
  100.   say 'Install failed due to missing drive. '
  101.   Signal Quit_Pgm
  102. End
  103. Parse var drinfo . drfree . .
  104. drneed = 770000
  105. If drfree < drneed Then do
  106.   say ' '
  107.   say 'Drive 'sinkdrive' has 'drfree' bytes free, install needs 'drneed' bytes.'
  108.   say 'Install failed due to insufficient space on drive 'sinkdrive
  109.   Signal Quit_Pgm
  110. End
  111.  
  112. /* Copy the files...   */
  113. here = stream(os2_dll_fsp||'\'||save_file_3, 'C', 'query exists')
  114. If here \= '' Then do
  115.   say ' '
  116.   say os2_dll_fsp||'\'||save_file_3' already exists.  Install copies 'os2_dll_fsp||'\'||file_3
  117.   say ' to 'save_file_3' , so this file will be replaced by the existing 'file_3' . '
  118.   say ' Is this ok?  Responses are:  Y (yes) or N (no) - any other response quits: '
  119.   Parse UPPER value SysGetKey('NOECHO') with key
  120.   If key \= 'Y' & key \= 'N' Then do
  121.     say ' '
  122.     say 'Install ended at your request. '
  123.     Signal Quit_Pgm
  124.   End
  125.   Else If key = 'N' Then say 'Kept existing 'save_file_3' at your request.'
  126. End
  127.  
  128. If here = '' | key = 'Y' Then
  129.   'copy 'os2_dll_fsp||'\'||file_3  os2_dll_fsp||'\'||save_file_3
  130.  
  131. 'copy 'inst_fsp||'\'||file_1  os2_fsp||'\'||file_1
  132. 'copy 'inst_fsp||'\'||file_2  os2_dll_fsp||'\'||file_2
  133. 'copy 'inst_fsp||'\'||file_3  os2_dll_fsp||'\'||file_3
  134. 'copy 'inst_fsp||'\'||file_4  os2_boot_fsp||'\'||file_4
  135. say ' '
  136. say 'Install completed successfully. '
  137.  
  138. Quit_Pgm:
  139. call SysDropFuncs
  140.  
  141. Exit 0
  142.