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.

90 lines
2.3 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. for %%f in (%patchtemp%\z) do mkdir %%~dpf 2>nul
  9. for %%f in (%patchexe%) do mkdir %%~dpf 2>nul
  10. echo %~n0: start %date% %time% > %logfile%
  11. if exist %patchddf% erase %patchddf%
  12. if exist %patchcab% erase %patchcab%
  13. if exist %patchexe% erase %patchexe%
  14. call %bldtools%\setlog %loglinkpath% %logpath%
  15. :ddfbuild
  16. if not exist %bldtools%\patchddf.template goto ddffail
  17. if not exist %bldtools%\%patchlist% goto ddffail
  18. copy %bldtools%\patchddf.template %patchddf% >nul
  19. for /f %%f in (%bldtools%\%patchlist%) do call :AddFile %%f
  20. if exist %patchddf% goto cabbuild
  21. :ddffail
  22. echo %~n0: failed to build DDF (missing template or filelist?)
  23. goto leave
  24. :cabbuild
  25. echo makecab /f %patchddf% /d CabinetName1=%patchcab% >> %logfile%
  26. makecab /f %patchddf% /d CabinetName1=%patchcab% >> %logfile%
  27. if not errorlevel 1 goto exebuild
  28. :cabfail
  29. echo %~n0: MAKECAB failed: errorlevel %errorlevel%
  30. goto leave
  31. :exebuild
  32. if not exist %patchcab% goto cabfail
  33. echo makesfx %patchcab% %patchexe% /run /stub %stubexe% %nonsysfree% >> %logfile%
  34. makesfx %patchcab% %patchexe% /run /stub %stubexe% %nonsysfree% >> %logfile%
  35. if not errorlevel 1 goto done
  36. echo makesfx %patchcab% %patchexe% /run /stub %stubexe% >> %logfile%
  37. makesfx %patchcab% %patchexe% /run /stub %stubexe% >> %logfile%
  38. if not errorlevel 1 goto done
  39. :exefail
  40. echo %~n0: MAKESFX failed: errorlevel %errorlevel%
  41. goto leave
  42. :done
  43. if not exist %patchexe% goto failedexe
  44. echo %~n0 finished %patchexe%
  45. :leave
  46. echo %~n0: end %date% %time% >> %logfile%
  47. endlocal
  48. goto :EOF
  49. :AddFile
  50. set _run=
  51. if "%1"=="update\update.exe" set _run=/RUN
  52. rem If there's a patching version of this file, use it,
  53. rem otherwise use the file from the new build.
  54. set _name=%newfiles%\%1
  55. if exist %patching%\%1 set _name=%patching%\%1
  56. if exist %_name% echo "%_name%" "%1" %_run% >> %patchddf%
  57. goto :EOF