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.

35 lines
852 B

  1. @echo off
  2. echo Resign all catalog files in the current directory tree
  3. echo NOTE: DO NOT RUN THIS IN A SOURCE DEPOT CONTROLLED TREE
  4. pause
  5. set catlist=cjime cwms4 dajavac Dx3 eicona eiconp hpcrdp iasnt4
  6. set catlist=%catlist% mapimig mw770
  7. set catlist=%catlist% osccab PHIME pyime scrdbcat wfc wmi3rd xmldsoc
  8. for %%l in (%catlist%) do call :searchfile %%l
  9. goto :end
  10. :searchfile
  11. echo Searching for %1.ca_ and %1.cat
  12. for /f %%f in ('dir /s /b %1.ca_') do call :signfile %%f
  13. for /f %%f in ('dir /s /b %1.cat') do call :signfile %%f
  14. goto :end
  15. :signfile
  16. echo resigning %1
  17. if /i "%~x1" == ".ca_" (
  18. expand -r %1 %~p1
  19. )
  20. if defined SIGNTOOL_SIGN (
  21. signtool sign /q %SIGNTOOL_SIGN% %~p1%~n1.cat
  22. ) else (
  23. signcode -sha1 %NT_CERTHASH% %~p1%~n1.cat
  24. )
  25. if /i "%~x1" == ".ca_" (
  26. compress -zx21 -r %~p1%~n1.cat %~p1
  27. del %~p1%~n1.cat
  28. )
  29. goto :end
  30. :end