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.

185 lines
7.0 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM shimbind.cmd
  5. REM Binds the appcompat shims
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. if defined _CPCMAGIC goto CPCBegin
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. #!perl
  14. use strict;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use PbuildEnv;
  18. use ParseArgs;
  19. use Logmsg;
  20. sub Usage { print<<USAGE; exit(1) }
  21. shimbind [-l <language>]
  22. Binds the appcompat shims
  23. USAGE
  24. sub Dependencies {
  25. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  26. errmsg("Unable to open dependency list file.");
  27. die;
  28. }
  29. print DEPEND<<DEPENDENCIES;
  30. \[$0\]
  31. IF {
  32. sysmain.sdb
  33. apphelp.sdb
  34. apph_sp.sdb
  35. msimain.sdb
  36. drvmain.sdb
  37. apps.chm
  38. drvmain.inf
  39. migdb.inf
  40. ntcompat.inf
  41. secdrv.sys
  42. }
  43. ADD { shimdll\\... }
  44. DEPENDENCIES
  45. close DEPEND;
  46. exit;
  47. }
  48. my $qfe;
  49. parseargs('?' => \&Usage,
  50. 'plan' => \&Dependencies,
  51. 'qfe:' => \$qfe);
  52. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  53. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  54. errmsg("Unable to open skip list file.");
  55. die;
  56. }
  57. while (<SKIP>) {
  58. chomp;
  59. exit if lc$_ eq lc$0;
  60. }
  61. close SKIP;
  62. }
  63. # *** NEXT FEW LINES ARE TEMPLATE ***
  64. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  65. __END__
  66. :CPCBegin
  67. set _CPCMAGIC=
  68. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  69. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  70. REM Incremental check
  71. set Bindiff=%_NTPostBld%\build_logs\bindiff.txt
  72. set Inputs=driver.xml dbu.xml apphelp.xml apphelpu.xml secdrv.sys
  73. if exist %Bindiff% (
  74. set ChangedInputs=0
  75. for %%a in (%Inputs%) do (
  76. findstr /ilc:"%_NTPostBld%\shimdll\%%a" %BinDiff%
  77. if /i "!ErrorLevel!" == "0" set /a ChangedInputs=!ChangedInputs! + 1
  78. )
  79. if !ChangedInputs! EQU 0 (
  80. @echo Skipping - No inputs changed
  81. goto :IncrementalSkip
  82. )
  83. )
  84. pushd %_NTPostbld%\shimdll
  85. md drvmain
  86. md apps_sp
  87. set _SLANG=%LANG%
  88. if /I "%LANG%" equ "CHH" (set _SLANG=CHT)
  89. call ExecuteCmd.cmd "shimdbc custom -l %_SLANG% -ov 5.1 -x makefile.xml"
  90. set RegSvr_Name=regsvr32.exe
  91. if "%PROCESSOR_ARCHITECTURE%" neq "x86" set RegSvr_Name=%windir%\syswow64\%RegSvr_Name%
  92. call ExecuteCmd.cmd "%RegSvr_Name% /s itcc.dll"
  93. set RegSvr_Name=
  94. %_NTPostbld%\shimdll\hhc apps.hhp
  95. pushd %_NTPostbld%\shimdll\apps_sp
  96. %_NTPostbld%\shimdll\hhc apps_sp.hhp
  97. popd
  98. pushd %_NTPostbld%\shimdll\drvmain
  99. %_NTPostbld%\shimdll\hhc drvmain.hhp
  100. popd
  101. call ExecuteCmd.cmd "copy sysmain.sdb %_NTPostBld%"
  102. call ExecuteCmd.cmd "copy apphelp.sdb %_NTPostBld%"
  103. call ExecuteCmd.cmd "copy apph_sp.sdb %_NTPostBld%"
  104. call ExecuteCmd.cmd "copy msimain.sdb %_NTPostBld%"
  105. call ExecuteCmd.cmd "copy drvmain.sdb %_NTPostBld%"
  106. call ExecuteCmd.cmd "copy apps.chm %_NTPostBld%"
  107. call ExecuteCmd.cmd "copy apps_sp\apps_sp.chm %_NTPostBld%"
  108. REM Copy CHM and INF messages to compdata dirs
  109. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\winnt32\compdata"
  110. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\perinf\winnt32\compdata"
  111. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\srvinf\winnt32\compdata"
  112. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\blainf\winnt32\compdata"
  113. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\entinf\winnt32\compdata"
  114. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\dtcinf\winnt32\compdata"
  115. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\winnt32\compdata"
  116. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\perinf\winnt32\compdata"
  117. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\srvinf\winnt32\compdata"
  118. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\blainf\winnt32\compdata"
  119. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\entinf\winnt32\compdata"
  120. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\dtcinf\winnt32\compdata"
  121. REM Remove this line once Setup has removed their dependency on appmig.inf
  122. call ExecuteCmd.cmd "copy appmig.inx %_NTPostBld%\appmig.inf"
  123. REM Append migration entries from AppCompat XML db to setup's migdb.inf
  124. REM Only do this for pro and per, since those are the only SKUs that allow migration
  125. if /i "%_BuildArch%" neq "x86" goto SkipAppendAppCompat
  126. @echo Appending to MigDB...
  127. call ExecuteCmd.cmd "copy %_NTPostBld%\winnt32\win9xupg\migdb.inf .\migdb_pro.inf"
  128. call ExecuteCmd.cmd "copy %_NTPostBld%\perinf\winnt32\win9xupg\migdb.inf .\migdb_per.inf"
  129. call ExecuteCmd.cmd "infstrip migdb_pro.inf ___APPCOMPAT_MIG_ENTRIES___"
  130. call ExecuteCmd.cmd "infstrip migdb_per.inf ___APPCOMPAT_MIG_ENTRIES___"
  131. call ExecuteCmd.cmd "copy /y /b migdb_pro.inf+migapp.txt+migapp.inx %_NTPostBld%\winnt32\win9xupg\migdb.inf"
  132. call ExecuteCmd.cmd "copy /y /b migdb_per.inf+migapp.txt+migapp.inx %_NTPostBld%\perinf\winnt32\win9xupg\migdb.inf"
  133. @echo Appending to NTCOMPAT...
  134. call ExecuteCmd.cmd "copy %_NTPostBld%\winnt32\compdata\ntcompat.inf .\ntcompat_pro.inf"
  135. call ExecuteCmd.cmd "copy %_NTPostBld%\perinf\winnt32\compdata\ntcompat.inf .\ntcompat_per.inf"
  136. call ExecuteCmd.cmd "copy %_NTPostBld%\srvinf\winnt32\compdata\ntcompat.inf .\ntcompat_srv.inf"
  137. call ExecuteCmd.cmd "copy %_NTPostBld%\blainf\winnt32\compdata\ntcompat.inf .\ntcompat_bla.inf"
  138. call ExecuteCmd.cmd "copy %_NTPostBld%\entinf\winnt32\compdata\ntcompat.inf .\ntcompat_ent.inf"
  139. call ExecuteCmd.cmd "copy %_NTPostBld%\dtcinf\winnt32\compdata\ntcompat.inf .\ntcompat_dtc.inf"
  140. call ExecuteCmd.cmd "infstrip ntcompat_pro.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  141. call ExecuteCmd.cmd "infstrip ntcompat_per.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  142. call ExecuteCmd.cmd "infstrip ntcompat_srv.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  143. call ExecuteCmd.cmd "infstrip ntcompat_bla.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  144. call ExecuteCmd.cmd "infstrip ntcompat_ent.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  145. call ExecuteCmd.cmd "infstrip ntcompat_dtc.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  146. call ExecuteCmd.cmd "copy /y /b ntcompat_pro.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\winnt32\compdata\ntcompat.inf"
  147. call ExecuteCmd.cmd "copy /y /b ntcompat_per.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\perinf\winnt32\compdata\ntcompat.inf"
  148. call ExecuteCmd.cmd "copy /y /b ntcompat_srv.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\srvinf\winnt32\compdata\ntcompat.inf"
  149. call ExecuteCmd.cmd "copy /y /b ntcompat_bla.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\blainf\winnt32\compdata\ntcompat.inf"
  150. call ExecuteCmd.cmd "copy /y /b ntcompat_ent.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\entinf\winnt32\compdata\ntcompat.inf"
  151. call ExecuteCmd.cmd "copy /y /b ntcompat_dtc.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\dtcinf\winnt32\compdata\ntcompat.inf"
  152. @echo Copying SafeDisc driver to retail directory...
  153. call ExecuteCmd.cmd "copy /y /b %_NTPostBld%\shimdll\secdrv.sys %_NTPostBld%\secdrv.sys"
  154. :SkipAppendAppCompat
  155. @echo Copying HTMs to ASPs for microsoft.com propogation...
  156. md ASPs
  157. call ExecuteCmd.cmd "copy /y /b idh*.htm ASPs\*.asp"
  158. popd
  159. :IncrementalSkip