home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / softinst / bldinst.cm_ / BLDINST.CMD
Encoding:
Text File  |  1993-10-14  |  4.1 KB  |  148 lines

  1. /**********************************************************************
  2. **                      SOFTWARE INSTALLER
  3. ** 5621-434 (C) COPYRIGHT IBM CORP. 1991, 1993. ALL RIGHTS RESERVED.
  4. **             LICENSED MATERIALS - PROPERTY OF IBM
  5. ***********************************************************************
  6. **
  7. ** BLDINST.CMD -- Creates INSTALL.IN_ from the renamed copy of Install.
  8. **
  9. ** DO NOT MAKE ANY CHANGES TO THIS FILE!
  10. **
  11. */
  12.  
  13. trace 'o'
  14. parse arg ExtraFiles
  15.  
  16. /* Load the RexxUtil functions */
  17. call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree'
  18.  
  19. Prefix = 'EPFPREFIX:EPF'
  20.  
  21. /* Query the new prefix */
  22. if pos(':', Prefix) <> 0
  23. then do
  24.    /* Prefix found */
  25.    parse value Prefix with . ':' RenamedPrefix
  26. end   /* end then */
  27. else do
  28.    /* Prefix not found; use default */
  29.    RenamedPrefix = 'EPF'
  30. end   /* end else */
  31.  
  32. /* Query the files in the current directory */
  33. CurrentFiles. = ''
  34. SysFTrc = SysFileTree('.\*.*', 'CurrentFiles', 'FO')
  35.  
  36. /* Read the IIRC.RC to get the included files */
  37. IIRCFile    = "IIRC.RC"
  38. IIRCLines.0 = 0
  39.  
  40. do while lines(IIRCFile) > 0
  41.    IIRCLines.0 = IIRCLines.0 + 1
  42.    Temp        = IIRCLines.0
  43.  
  44.    IIRCLines.Temp = linein(IIRCFile)
  45. end   /* end do */
  46.  
  47. rc = lineout(IIRCFile)       /* close the file */
  48.  
  49. /* Parse the IIRC.RC */
  50. IncludedFiles.  = ''
  51. IncludedFiles.0 = 0
  52.  
  53. do I = 1 to IIRCLines.0
  54.    Found = FALSE
  55.    parse value IIRCLines.I with Tag ','  '"'Value'"'
  56.    parse upper var Tag Tag          /* upper case Tag */
  57.  
  58.    UValue = Value
  59.    parse upper var UValue UValue    /* upper case UValue */
  60.  
  61.    if Tag = 'INFO1_FILE' |,
  62.       Tag = 'INFO2_FILE' |,
  63.       Tag = 'STARTPARM_RESPFILE'
  64.    then do
  65.       Found = TRUE
  66.    end   /* end then */
  67.  
  68.    parse value IIRCLines.I with Tag '"'Value'"'
  69.    parse upper var Tag Tag          /* upper case Tag */
  70.  
  71.    UValue = Value
  72.    parse upper var UValue UValue    /* upper case UValue */
  73.  
  74.    if Tag = 'INFO1_FILE' |,
  75.       Tag = 'INFO2_FILE' |,
  76.       Tag = 'STARTPARM_RESPFILE'
  77.    then do
  78.       Found = TRUE
  79.    end   /* end then */
  80.  
  81.    if Found = TRUE
  82.    then do
  83.       /* Add the file to the included list */
  84.       /* but only if exists on the disk    */
  85.       do J = 1 to CurrentFiles.0
  86.          CurrentFiles.J = strip(CurrentFiles.J)
  87.          CurrentFileName = right(CurrentFiles.J, length(UValue))
  88.          parse upper var CurrentFileName CurrentFileName
  89.  
  90.          if CurrentFileName = UValue
  91.          then do
  92.             IncludedFiles.0 = IncludedFiles.0 + 1
  93.             Temp = IncludedFiles.0
  94.             IncludedFiles.Temp = Value
  95.             leave
  96.          end   /* end then */
  97.       end   /* end do */
  98.    end   /* end then */
  99. end   /* end do */
  100.  
  101. /* Create the list of files included in INSTALL.IN_ */
  102. 'echo' RenamedPrefix'insts.exe > temp.lst'
  103. 'echo' RenamedPrefix'iprcs.exe >> temp.lst'
  104. 'echo' RenamedPrefix'ipii.dll  >> temp.lst'
  105. 'echo' RenamedPrefix'iexts.dll >> temp.lst'
  106. 'echo' RenamedPrefix'ihplb.hlp >> temp.lst'
  107. 'echo' RenamedPrefix'imsg.msg  >> temp.lst'
  108. 'echo' RenamedPrefix'idlds.exe >> temp.lst'
  109. 'echo' RenamedPrefix'iupck.exe >> temp.lst'
  110. 'echo' RenamedPrefix'iicis.ico >> temp.lst'
  111.  
  112. /* Add the files referenced in the IIRC.RC */
  113. do I = 1 to IncludedFiles.0
  114.    'echo' IncludedFiles.I '>> temp.lst'
  115. end   /* end do */
  116.  
  117. /* Check if xxxIHOOK.DLL is present */
  118. HookDLLName = RenamedPrefix'ihook.dll'
  119. UHookDLLName = HookDLLName
  120. parse upper var UHookDLLName UHookDLLName
  121.  
  122. do I = 1 to CurrentFiles.0
  123.    CurrentFiles.I = strip(CurrentFiles.I)
  124.    CurrentFileName = right(CurrentFiles.I, length(UHookDLLName))
  125.    parse upper var CurrentFileName CurrentFileName
  126.  
  127.    if CurrentFileName = UHookDLLName
  128.    then do
  129.       'echo' HookDLLName '>> temp.lst'
  130.       leave
  131.    end   /* end then */
  132. end   /* end do */
  133.  
  134. /* Parse the input filenames */
  135. do while length(ExtraFiles) > 0
  136.    parse value ExtraFiles with ExtraFile ExtraFiles
  137.    'echo' ExtraFile '>> temp.lst'
  138. end   /* end do */
  139.  
  140. /* Create INSTALL.IN_ */
  141. RenamedPrefix'ipack temp.lst install.in_ /L'
  142. 'del temp.lst'
  143.  
  144. /* Drop the RexxUtil functions */
  145. call RxFuncDrop 'SysFileTree'
  146.  
  147. exit
  148.