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.

164 lines
4.9 KiB

  1. @echo off
  2. setlocal ENABLEEXTENSIONS
  3. setlocal ENABLEDELAYEDEXPANSION
  4. if DEFINED _echo echo on
  5. if DEFINED verbose echo on
  6. REM ------------------------------------------------
  7. REM Get command-line options
  8. REM ------------------------------------------------
  9. set quiet_mode=
  10. if /I "%1" == "/q" set quiet_mode=1
  11. if /I "%1" == "-q" set quiet_mode=1
  12. if "%quiet_mode%" == "1" shift
  13. set Version=5.1
  14. if /I "%1" == "/5.0" set Version=5.0
  15. if /I "%1" == "-5.0" set Version=5.0
  16. if "%Version%" == "5.0" shift
  17. for %%a in (./ .- .) do if ".%1." == "%%a?." goto Usage
  18. if "%1" == "" goto Usage
  19. if "%_NTBINDIR%"=="" echo please set "_NTBINDIR" = to your nt drive, e.g. _NTBINDIR=d:\nt&goto usage
  20. REM ------------------------------------------------
  21. REM Set environment variables, make temp directories,
  22. REM delete stale files
  23. REM ------------------------------------------------
  24. set infflag=
  25. set mydir=%1
  26. set cdf=%tmp%\cdf
  27. set log=%tmp%\log
  28. if NOT exist %tmp%\cdf md %tmp%\cdf
  29. if NOT exist %tmp%\log md %tmp%\log
  30. if exist %cdf%\delta.cdf del %cdf%\delta.cdf
  31. if exist %cdf%\delta.log del %log%\delta.log
  32. pushd %mydir%
  33. if exist delta.cat del delta.cat
  34. if exist layout.inf set infflag=1
  35. if exist syssetup.inf set infflag=1
  36. if "%quiet_mode%" == "1" goto skiphelp
  37. if "%infflag%"=="1" call :nt5inf
  38. :skiphelp
  39. REM ------------------------------------------------
  40. REM Prepare a cdf file
  41. REM ------------------------------------------------
  42. echo Creating the delta.cdf ...
  43. REM Put the header on and output it as a CDF
  44. echo ^[CatalogHeader^]> %cdf%\delta.CDF
  45. echo Name=delta>> %cdf%\delta.CDF
  46. echo PublicVersion=0x0000001>> %cdf%\delta.CDF
  47. echo EncodingType=0x00010001>> %cdf%\delta.CDF
  48. echo CATATTR1=0x10010001:OSAttr:2:!Version!>> %cdf%\delta.CDF
  49. echo ^[CatalogFiles^]>> %cdf%\delta.CDF
  50. for /f %%a in ('dir /a-d /b %mydir%') do (
  51. if NOT "%%a"=="" echo ^<hash^>%mydir%\%%a=%mydir%\%%a>>%cdf%\delta.cdf)
  52. REM ------------------------------------------------
  53. REM Make the catalog and test sign it
  54. REM ------------------------------------------------
  55. echo Making the delta.cat ...
  56. REM popd and pushd just in case some sneaky dlls are hanging around in
  57. REM the user passed %mydir%
  58. popd
  59. makecat -n -v %cdf%\delta.cdf > %log%\delta.log
  60. copy delta.cat %mydir%
  61. copy %cdf%\delta.cdf %mydir%
  62. pushd %SDXROOT%
  63. echo Signing delta.cat ...
  64. setreg -q 1 TRUE
  65. if defined SIGNTOOL_SIGN (
  66. signtool sign %SIGNTOOL_SIGN% "%mydir%\delta.CAT"
  67. ) else (
  68. if not "%NT_CERTHASH%" == "" (
  69. signcode -sha1 %NT_CERTHASH% -n "Microsoft Windows NT Driver Catalog TEST" -i "http://ntbld" %mydir%\delta.CAT
  70. ) else (
  71. signcode -v %RazzleToolPath%\driver.pvk -spc %RazzleToolPath%\driver.spc -n "Microsoft Windows NT Driver Catalog TEST" -i "http://ntbld" %mydir%\delta.CAT
  72. )
  73. )
  74. echo Done.
  75. popd
  76. goto end
  77. :nt5inf
  78. echo IF you have either layout.inf or syssetup.inf
  79. echo in your signing directory. Deltacat will not
  80. echo sign these files which must be signed in nt5inf.cat.
  81. echo.
  82. echo Let deltacat run then do the following:
  83. echo 1. Copy nt5inf.ca_ to your signing directory
  84. echo from wherever your are installing, e.g.
  85. echo \\ntbuilds\release\usa\latest.tst\x86\fre.wks,
  86. echo or, e.g. e:\i386.
  87. echo 2. Make sure you have the most recent updcat.exe
  88. echo in your %windir%\idw directory
  89. echo 3. Run infsign.cmd
  90. echo 4. Then run winnt32 with /m:signing directory
  91. echo.
  92. echo These instructions are also in the help for
  93. echo deltacat.cmd and infsign.cmd
  94. echo.
  95. pause
  96. goto :eof
  97. REM ------------------------------------------------
  98. REM Display Usage:
  99. REM ------------------------------------------------
  100. :usage
  101. echo Deltacat.cmd [q] [5.0] ^<path to bins^>
  102. echo.
  103. echo [/q] [-q] Quiet mode
  104. echo [/5.0] [-5.0] Nt 5 version - NT 5.1 is default
  105. echo ^<path to bins^> FULL PATH to bins. Do not run in bins directory.
  106. echo.
  107. echo.
  108. echo Creates a catalog file, "delta.cat" for files in the directory
  109. echo passed as input. For example: If you have ntoskrnl.exe and pci.sys
  110. echo in a directory "d:\BINARIES," running "deltacat d:\BINARIES"
  111. echo will create a delta.cat and place it in the d:\BINARIES directory.
  112. echo.
  113. echo Then to setup test your binaries use the /m switch with winnt32
  114. echo get your binaries and catalog file from d:\BINARIES. For example,
  115. echo run \\ntubilds\release\usa\latest.tst\x86\fre.wks\winnt32
  116. echo \winnt32.exe /m:d:\BINARIES.
  117. echo.
  118. echo IF you have either LAYOUT.INF or SYSSETUP.INF
  119. echo in your signing directory. Deltacat will not
  120. echo sign these files which must be signed in nt5inf.cat.
  121. echo.
  122. echo Let deltacat run then do the following:
  123. echo 1. Copy nt5inf.ca_ to your signing directory
  124. echo from wherever your are installing, e.g.
  125. echo \\ntbuilds\release\usa\latest.tst\x86\fre.wks,
  126. echo or, e.g. e:\i386.
  127. echo 2. Make sure you have the most recent updcat.exe
  128. echo in your %windir%\idw directory
  129. echo 3. Run infsign.cmd
  130. echo 4. Then run winnt32 with /m:signing directory
  131. echo.
  132. :end
  133. @ENDLOCAL