home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / insthint.zip / bldinst.cmd next >
OS/2 REXX Batch file  |  1996-05-10  |  4KB  |  159 lines

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