Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.8 KiB

  1. @setlocal
  2. @if "%_echo%" == "" echo off
  3. set bldtools=%~dp0
  4. path %bldtools%;%path%
  5. call %1 %1 %2 %3 %4 %5
  6. set logfile=%logpath%\%~n0.log
  7. for %%f in (%logfile%) do mkdir %%~dpf 2>nul
  8. echo %~n0: start %date% %time% > %logfile%
  9. call %bldtools%\setlog %loglinkpath% %logpath%
  10. rem if the timestamp still matches, don't need to rebuild the stage
  11. if not exist %forest%\stage\timestamp goto noStamp
  12. if not exist %newfiles%\*.dl* goto noStamp
  13. echo dir %newbuild%\%newexe% /tw ^| findstr /i %newexe% ^> %forest%\stage\timestamp.now >> %logfile%
  14. dir %newbuild%\%newexe% /tw | findstr /i %newexe% > %forest%\stage\timestamp.now
  15. echo comp1 %forest%\stage\timestamp %forest%\stage\timestamp.now >> %logfile%
  16. type %forest%\stage\timestamp >> %logfile%
  17. type %forest%\stage\timestamp.now >> %logfile%
  18. comp1 %forest%\stage\timestamp %forest%\stage\timestamp.now >> %logfile%
  19. if not errorlevel 1 goto noUpdate
  20. :noStamp
  21. echo if not exist %newbuild%\%newexe% goto nofiles >> %logfile%
  22. if not exist %newbuild%\%newexe% goto nofiles
  23. echo rd /s /q %forest%\stage >> %logfile%
  24. rd /s /q %forest%\stage 2>nul
  25. echo md %forest%\stage >> %logfile%
  26. md %forest%\stage >> %logfile%
  27. echo cd /d %forest%\stage >> %logfile%
  28. cd /d %forest%\stage >> %logfile%
  29. rem copy all the build files
  30. dir %newbuild%\%newexe% /tw | findstr /i %newexe% > %forest%\stage\timestamp.tmp
  31. echo copy %newbuild%\%newexe% >> %logfile%
  32. copy %newbuild%\%newexe% >> %logfile%
  33. echo if not exist %newexe% goto nofiles >> %logfile%
  34. if not exist %newexe% goto nofiles
  35. echo %newexe% /x:%forest%\stage\extract /u >> %logfile%
  36. md %forest%\stage\extract
  37. %newexe% /x:%forest%\stage\extract /u >> %logfile%
  38. echo move extract %newfiles% >> %logfile%
  39. move extract %newfiles% >> %logfile%
  40. if exist %newfiles%\*.dl* goto gotfiles
  41. :nofiles
  42. echo %~n0: no files found at %newbuild% >> %logfile%
  43. echo %~n0: no files found at %newbuild%
  44. goto leave
  45. :gotfiles
  46. if exist extract rd extract /s /q
  47. del %newexe%
  48. cd %newfiles%
  49. echo if exist %newbuild%\readmesp.htm copy %newbuild%\readmesp.htm >> %logfile%
  50. if exist %newbuild%\readmesp.htm copy %newbuild%\readmesp.htm >> %logfile%
  51. echo if exist %newbuild%\winxp_logo_horiz_sm.gif copy %newbuild%\winxp_logo_horiz_sm.gif >> %logfile%
  52. if exist %newbuild%\winxp_logo_horiz_sm.gif copy %newbuild%\winxp_logo_horiz_sm.gif >> %logfile%
  53. echo xcopy %newsymbols% symbols\ /s /h /q >> %logfile%
  54. xcopy %newsymbols% symbols\ /s /h /q >> %logfile%
  55. if exist %newfiles%\symbols\dll\kernel32.* goto symsdone
  56. if exist %newfiles%\symbols\*.cab goto gotsyms
  57. echo %~n0: no symbols found with %newbuild% >> %logfile%
  58. rem echo %~n0: no symbols found with %newbuild%
  59. goto symsdone
  60. :gotsyms
  61. cd symbols
  62. echo perl %bldtools%\noprompt.pl %newfiles%\symbols \< symbols_sp.inf \> z.inf >> %logfile%
  63. perl %bldtools%\noprompt.pl %newfiles%\symbols < symbols_sp.inf > z.inf
  64. echo rundll32 advpack,LaunchINFSection z.inf,DefaultInstall.x86 >> %logfile%
  65. rundll32 advpack,LaunchINFSection z.inf,DefaultInstall.x86
  66. del /f /q *
  67. cd ..
  68. :symsdone
  69. rem we don't need any special attribs around here
  70. echo attrib -r -h -s * /s >> %logfile%
  71. attrib -r -h -s * /s >> %logfile%
  72. rem expand all the simple compressed files
  73. echo for /r %%f in (*_) do call flat.bat %%~pf %%~nxf >> %logfile%
  74. for /r %%f in (*_) do call flat.bat %%~pf %%~nxf >> %logfile%
  75. rem expand all the CABs we can rebuild
  76. rem expand into the root, but don't overwrite any existing files
  77. rem by definition (eventually) those duplicates are identical anyway
  78. echo for %%f in (%cablist%) do call crackcab.bat %%f >> %logfile%
  79. for %%f in (%cablist%) do call crackcab.bat %%f >> %logfile%
  80. rem make sure there are no attributes
  81. echo attrib -r -h -s * /s >> %logfile%
  82. attrib -r -h -s * /s >> %logfile%
  83. echo tolower . /s >> %logfile%
  84. tolower . /s >> %logfile%
  85. echo makefest . /s >> %logfile%
  86. makefest . /s >> %logfile%
  87. ren %forest%\stage\timestamp.tmp timestamp
  88. goto done
  89. :noUpdate
  90. echo %~n0 found %newfiles% was already current >> %logfile%
  91. echo %~n0 found %newfiles% was already current
  92. echo (delete %forest%\stage\timestamp to force a rebuild) >> %logfile%
  93. echo (delete %forest%\stage\timestamp to force a rebuild)
  94. if exist %forest%\stage\timestamp.now del %forest%\stage\timestamp.now
  95. goto leave
  96. :done
  97. echo %~n0 finished %newfiles%
  98. :leave
  99. echo %~n0: end %date% %time% >> %logfile%
  100. endlocal