home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 14 / 14.iso / s / s029 / os2_dsk1.ddi / MPMCDIMG.CMD < prev    next >
Encoding:
Text File  |  1993-05-05  |  4.4 KB  |  154 lines

  1. /* -------------------WARNING------------------*/ 
  2. /* Do not change without notifying ROC Conder  */ 
  3. /* -------------------WARNING------------------*/ 
  4. /*            MPMCDIMG.CMD                     */ 
  5.  
  6. /* MultiMedia Installation Routine to make a Hard Disk image of the 
  7.    installation package and to modify the control files for hard disk.  */ 
  8.  
  9. parse upper arg DRIVE PATH 
  10. '@echo off' 
  11.  
  12. say '    ' 
  13. say "This CMD copies the MMPM/2 installation package from diskette to hard disk "
  14. say "and changes the control files to the correct ones for hard disk operation. "
  15. say "The hard disk installation package can then be used in response file "
  16. say "generation and installation."  
  17. say '    ' 
  18.  
  19. if length(DRIVE) <> 1 then call usage 
  20.  
  21. say "Usage: MPMCDIMG drive_letter [path]"  
  22. say '    ' 
  23. say '                '"PATH is any number of path levels but only the last one "
  24. say "                may not exist. More than one non-existent path level may "
  25. say "                cause errors."  
  26. say '    ' 
  27.  
  28. INPUTFILE='A:\CONTROL.SCR' 
  29. x=stream(INPUTFILE, 'c', 'close') 
  30.  
  31. signal on notready name fileclosed 
  32.  
  33. nextline=linein(INPUTFILE) 
  34. nounits=0 
  35. do forever 
  36.      nextline=linein(INPUTFILE) 
  37.      if nextline <> '' then 
  38.          do 
  39.          if (substr(nextline,1,11) = 'munitcount=') then 
  40.               do 
  41.               nextline = nextline || '   ' 
  42.               nounits=substr(nextline,12,1) 
  43.               if (substr(nextline,13,1) <> ' ') then 
  44.                   do 
  45.                   nounits = nounits || substr(nextline,13,1) 
  46.                   end 
  47.               say "nounits = "nounits"" 
  48.               leave 
  49.               end 
  50.          end 
  51. end  /* do forever */ 
  52.  
  53. i = 0 
  54. do forever 
  55.     nextline=linein(INPUTFILE) 
  56.     if nextline <> '' then 
  57.          do 
  58.          if (substr(nextline, 1, 10) = 'medianame=') then 
  59.               do 
  60.               i = i + 1 
  61.               array.i = substr(nextline, 11) 
  62.               if i = nounits then 
  63.                    leave 
  64.               end 
  65.          end 
  66. end /* do forever */ 
  67. /* 
  68. do k = 1 to nounits 
  69.     say 'array['k'] = ('array.k')' 
  70. end 
  71. */ 
  72. fileclosed: 
  73.     signal off notready 
  74.  
  75.     x=stream(INPUTFILE, 'c', 'close') 
  76.  
  77. if length(PATH) = 0 then 
  78.     do 
  79.     PATH='\MPMPACK' 
  80.     end 
  81. say "Copying MMPM/2 to hard disk."  
  82. /* 
  83. array.1 = "IBM Multimedia Presentation Manager/2 Diskette 1"  
  84. array.2 = "IBM Multimedia Presentation Manager/2 Diskette 2"  
  85. array.3 = "IBM Multimedia Presentation Manager/2 Diskette 3"  
  86. array.4 = "IBM Multimedia Presentation Manager/2 Diskette 4"  
  87. array.5 = "IBM Multimedia Presentation Manager/2 Diskette 5"  
  88. array.6 = "IBM Multimedia Presentation Manager/2 Diskette 6"  
  89. array.7 = "IBM Multimedia Presentation Manager/2 Diskette 7"  
  90. array.8 = "IBM Multimedia Presentation Manager/2 Diskette 8"  
  91. array.9 = "IBM Multimedia Presentation Manager/2 Diskette 9"  
  92.   */ 
  93.  
  94. 'md' DRIVE':'PATH 
  95. 'attrib -R ' DRIVE':'PATH'\* /S >nul 2>nul' 
  96.  
  97. do k = 1 to nounits 
  98.    say '    ' 
  99.    say "Please insert"  array.k 
  100.    say "into diskette drive A:."  
  101.    say '    ' 
  102.    pause 
  103.  
  104.    'xcopy a:\*.* ' DRIVE':'PATH'\*.* /s /v    2>nul' 
  105. end 
  106.  
  107. DRIVE':' 
  108. if (nounits <> 1) then 
  109.    do 
  110.    'cd' PATH'\hdcontl' 
  111.    'copy controlh.scr ..\control.scr' 
  112.    INPUTFILE = 'controlh.scr' 
  113.    x = stream(INPUTFILE, 'c', 'close') 
  114.    signal on notready name controlread 
  115.    nextline = linein(INPUTFILE) 
  116.    do forever 
  117.       nextline = linein(INPUTFILE) 
  118.       if nextline <> '' then 
  119.          do 
  120.          if (substr(nextline, 1, 9) = 'filelist=') then 
  121.             do 
  122.             'copy' substr(nextline,10) '..' 
  123.             'erase' substr(nextline,10) 
  124.             leave 
  125.             end 
  126.          end 
  127.    end 
  128. controlhread: 
  129.    x = stream(INPUTFILE, 'c', 'close') 
  130.    'erase controlh.scr' 
  131.    'cd ..' 
  132.    'rmdir hdcontl' 
  133.    end 
  134.  
  135. say "Package Generation Finished..."  
  136.  
  137. exit 0 
  138.  
  139. usage: 
  140. say '    ' 
  141. say "Usage: MPMCDIMG drive_letter [path]"  
  142. say '    ' 
  143. say "Where drive_letter = Drive on which to generate the package (this is "
  144. say "      required)."  
  145. say '     ' 
  146. say '      '"[path] = the path without drive letter where the package should be "
  147. say "      generated. (This is optional. The default is MPMPACK.)"  
  148. say '     ' 
  149. say '      '"PATH is any number of path levels but only the last one may not "
  150. say "      exist. More than one non-existent path level may cause errors."  
  151. say '     ' 
  152.  
  153. exit 0 
  154.