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.

141 lines
6.1 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. sub Usage { print<<USAGE; exit(1) }
  20. shimbind [-l <language>]
  21. Binds the appcompat shims
  22. USAGE
  23. parseargs('?' => \&Usage);
  24. # *** NEXT FEW LINES ARE TEMPLATE ***
  25. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  26. __END__
  27. :CPCBegin
  28. set _CPCMAGIC=
  29. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  30. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  31. REM Incremental check
  32. set Bindiff=%_NTPostBld%\build_logs\bindiff.txt
  33. set Inputs=driver.xml dbu.xml apphelp.xml apphelpu.xml secdrv.sys
  34. if exist %Bindiff% (
  35. set ChangedInputs=0
  36. for %%a in (%Inputs%) do (
  37. findstr /ilc:"%_NTPostBld%\shimdll\%%a" %BinDiff%
  38. if /i "!ErrorLevel!" == "0" set /a ChangedInputs=!ChangedInputs! + 1
  39. )
  40. if !ChangedInputs! EQU 0 (
  41. @echo Skipping - No inputs changed
  42. goto :IncrementalSkip
  43. )
  44. )
  45. pushd %_NTPostBld%\shimdll
  46. md drvmain
  47. md apps_sp
  48. call ExecuteCmd.cmd "shimdbc custom -l %LANG% -ov 5.1 -x makefile.xml"
  49. set RegSvr_Name=regsvr32.exe
  50. if "%PROCESSOR_ARCHITECTURE%" neq "x86" set RegSvr_Name=%windir%\syswow64\%RegSvr_Name%
  51. call ExecuteCmd.cmd "%RegSvr_Name% /s itcc.dll"
  52. set RegSvr_Name=
  53. %_NTPostBld%\shimdll\hhc apps.hhp
  54. pushd %_NTPostBld%\shimdll\apps_sp
  55. %_NTPostBld%\shimdll\hhc apps_sp.hhp
  56. popd
  57. pushd %_NTPostBld%\shimdll\drvmain
  58. %_NTPostBld%\shimdll\hhc drvmain.hhp
  59. popd
  60. call ExecuteCmd.cmd "copy sysmain.sdb %_NTPostBld%"
  61. call ExecuteCmd.cmd "copy apphelp.sdb %_NTPostBld%"
  62. call ExecuteCmd.cmd "copy apph_sp.sdb %_NTPostBld%"
  63. call ExecuteCmd.cmd "copy msimain.sdb %_NTPostBld%"
  64. call ExecuteCmd.cmd "copy drvmain.sdb %_NTPostBld%"
  65. call ExecuteCmd.cmd "copy apps.chm %_NTPostBld%"
  66. call ExecuteCmd.cmd "copy apps_sp\apps_sp.chm %_NTPostBld%"
  67. REM Copy CHM and INF messages to compdata dirs
  68. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\winnt32\compdata"
  69. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\perinf\winnt32\compdata"
  70. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\srvinf\winnt32\compdata"
  71. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\blainf\winnt32\compdata"
  72. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\entinf\winnt32\compdata"
  73. call ExecuteCmd.cmd "copy /y drvmain\drvmain.inf %_NTPostBld%\dtcinf\winnt32\compdata"
  74. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\winnt32\compdata"
  75. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\perinf\winnt32\compdata"
  76. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\srvinf\winnt32\compdata"
  77. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\blainf\winnt32\compdata"
  78. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\entinf\winnt32\compdata"
  79. call ExecuteCmd.cmd "copy /y drvmain\drvmain.chm %_NTPostBld%\dtcinf\winnt32\compdata"
  80. REM Remove this line once Setup has removed their dependency on appmig.inf
  81. call ExecuteCmd.cmd "copy appmig.inx %_NTPostBld%\appmig.inf"
  82. REM Append migration entries from AppCompat XML db to setup's migdb.inf
  83. REM Only do this for pro and per, since those are the only SKUs that allow migration
  84. if /i "%_BuildArch%" neq "x86" goto SkipAppendAppCompat
  85. @echo Appending to MigDB...
  86. call ExecuteCmd.cmd "copy %_NTPostBld%\winnt32\win9xupg\migdb.inf .\migdb_pro.inf"
  87. call ExecuteCmd.cmd "copy %_NTPostBld%\perinf\winnt32\win9xupg\migdb.inf .\migdb_per.inf"
  88. call ExecuteCmd.cmd "infstrip migdb_pro.inf ___APPCOMPAT_MIG_ENTRIES___"
  89. call ExecuteCmd.cmd "infstrip migdb_per.inf ___APPCOMPAT_MIG_ENTRIES___"
  90. call ExecuteCmd.cmd "copy /y /b migdb_pro.inf+migapp.txt+migapp.inx %_NTPostBld%\winnt32\win9xupg\migdb.inf"
  91. call ExecuteCmd.cmd "copy /y /b migdb_per.inf+migapp.txt+migapp.inx %_NTPostBld%\perinf\winnt32\win9xupg\migdb.inf"
  92. @echo Appending to NTCOMPAT...
  93. call ExecuteCmd.cmd "copy %_NTPostBld%\winnt32\compdata\ntcompat.inf .\ntcompat_pro.inf"
  94. call ExecuteCmd.cmd "copy %_NTPostBld%\perinf\winnt32\compdata\ntcompat.inf .\ntcompat_per.inf"
  95. call ExecuteCmd.cmd "copy %_NTPostBld%\srvinf\winnt32\compdata\ntcompat.inf .\ntcompat_srv.inf"
  96. call ExecuteCmd.cmd "copy %_NTPostBld%\blainf\winnt32\compdata\ntcompat.inf .\ntcompat_bla.inf"
  97. call ExecuteCmd.cmd "copy %_NTPostBld%\entinf\winnt32\compdata\ntcompat.inf .\ntcompat_ent.inf"
  98. call ExecuteCmd.cmd "copy %_NTPostBld%\dtcinf\winnt32\compdata\ntcompat.inf .\ntcompat_dtc.inf"
  99. call ExecuteCmd.cmd "infstrip ntcompat_pro.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  100. call ExecuteCmd.cmd "infstrip ntcompat_per.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  101. call ExecuteCmd.cmd "infstrip ntcompat_srv.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  102. call ExecuteCmd.cmd "infstrip ntcompat_bla.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  103. call ExecuteCmd.cmd "infstrip ntcompat_ent.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  104. call ExecuteCmd.cmd "infstrip ntcompat_dtc.inf ___APPCOMPAT_NTCOMPAT_ENTRIES___"
  105. call ExecuteCmd.cmd "copy /y /b ntcompat_pro.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\winnt32\compdata\ntcompat.inf"
  106. call ExecuteCmd.cmd "copy /y /b ntcompat_per.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\perinf\winnt32\compdata\ntcompat.inf"
  107. call ExecuteCmd.cmd "copy /y /b ntcompat_srv.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\srvinf\winnt32\compdata\ntcompat.inf"
  108. call ExecuteCmd.cmd "copy /y /b ntcompat_bla.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\blainf\winnt32\compdata\ntcompat.inf"
  109. call ExecuteCmd.cmd "copy /y /b ntcompat_ent.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\entinf\winnt32\compdata\ntcompat.inf"
  110. call ExecuteCmd.cmd "copy /y /b ntcompat_dtc.inf+drvmain\ntcompat_drv.inf %_NTPostBld%\dtcinf\winnt32\compdata\ntcompat.inf"
  111. @echo Copying SafeDisc driver to retail directory...
  112. call ExecuteCmd.cmd "copy /y /b %_NTPostBld%\shimdll\secdrv.sys %_NTPostBld%\secdrv.sys"
  113. :SkipAppendAppCompat
  114. @echo Copying HTMs to ASPs for microsoft.com propogation...
  115. md ASPs
  116. call ExecuteCmd.cmd "copy /y /b idh*.htm ASPs\*.asp"
  117. popd
  118. :IncrementalSkip