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.

163 lines
3.5 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM Cmbins.cmd
  5. REM Create an iexpress self-extracting EXE (Cmbins.exe) from the
  6. REM CM binaries built during the build
  7. REM
  8. REM Copyright 2001 (c) Microsoft Corporation. All rights reserved.
  9. REM
  10. REM CONTACT: Quintinb
  11. REM ------------------------------------------------------------------
  12. if defined _CPCMAGIC goto CPCBegin
  13. perl -x "%~f0" %*
  14. goto :EOF
  15. #!perl
  16. use strict;
  17. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  18. use lib $ENV{RAZZLETOOLPATH};
  19. use PbuildEnv;
  20. use ParseArgs;
  21. sub Usage { print<<USAGE; exit(1) }
  22. Cmbins.cmd
  23. contact: Quintinb or CmDev
  24. Make Cmbins.exe (Binary cabinet used by Connection Manager Administration Kit)
  25. USAGE
  26. parseargs('?' => \&Usage);
  27. # *** NEXT FEW LINES ARE TEMPLATE ***
  28. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  29. __END__
  30. :CPCBegin
  31. set _CPCMAGIC=
  32. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  33. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  34. REM
  35. REM Nothing to do on ia64 as cmbins.exe is only needed on x86. Just exit happily.
  36. REM
  37. if /i "%_BuildArch%" == "ia64" (
  38. call logmsg.cmd "Nothing to do on IA64 => Cmbins.cmd completed successfully"
  39. popd& goto :EOF
  40. )
  41. REM
  42. REM go to our cab directory
  43. REM
  44. rd /q /s %_NTPostBld%\cmbins
  45. md %_NTPostBld%\cmbins
  46. pushd %_NTPostBld%\cmbins
  47. REM
  48. REM Now, copy all of the files we need from %_NTPostBld% to %_NTPostBld%\cmbins
  49. REM
  50. for %%i in (
  51. ccfgnt.dll
  52. cmcfg32.dll
  53. cmdial32.dll
  54. cmdl32.exe
  55. cmmgr32.exe
  56. cmmgr32.hlp
  57. cmmon32.exe
  58. cmpbk32.dll
  59. cmstp.exe
  60. cmutil.dll
  61. cnetcfg.dll
  62. cmexcept.inf
  63. ) do (
  64. copy /y %_NTPostBld%\%%i %_NTPostBld%\cmbins\%%i
  65. if errorlevel 1 (
  66. call errmsg.cmd "File %_NTPostBld%\%%i not found."
  67. popd& goto :EOF
  68. )
  69. )
  70. REM
  71. REM Sign the binaries
  72. REM
  73. call deltacat.cmd /5.0 %_NTPostBld%\cmbins
  74. if not exist %_NTPostBld%\cmbins\delta.cat (
  75. call errmsg.cmd "File %_NTPostBld%\cmbins\delta.cat not found. Deltacat failed."
  76. popd& goto :EOF
  77. )
  78. REM
  79. REM Ren delta.cat to cmexcept.cat
  80. REM
  81. if exist %_NTPostBld%\cmbins\cmexcept.cat del /f %_NTPostBld%\cmbins\cmexcept.cat
  82. ren %_NTPostBld%\cmbins\delta.cat cmexcept.cat
  83. if errorlevel 1 goto :EOF
  84. REM
  85. REM Copy in cmbins.sed
  86. REM
  87. copy /y %_NTPostBld%\cmbins.SED %_NTPostBld%\cmbins\cmbins.SED
  88. if errorlevel 1 (
  89. call errmsg.cmd "File %_NTPostBld%\cmbins.SED not found."
  90. popd& goto :EOF
  91. )
  92. REM
  93. REM Create cmbins.exe.
  94. REM As iexpress.exe does not set errorlevel in all error cases,
  95. REM base verification on cmbins.exe's existence.
  96. REM
  97. if exist .\cmbins.exe call ExecuteCmd.cmd "del /f cmbins.exe"
  98. if errorlevel 1 goto :EOF
  99. REM
  100. REM Munge the path so we use the correct wextract.exe to build the package with...
  101. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  102. REM
  103. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\loc\%LANG%
  104. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  105. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  106. call ExecuteCmd.cmd "start /wait iexpress.exe /M /N /Q cmbins.sed"
  107. REM
  108. REM Return the path to what it was before...
  109. REM
  110. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  111. if not exist cmbins.exe (
  112. call errmsg.cmd "iexpress.exe cmbins.sed failed."
  113. popd& goto :EOF
  114. )
  115. REM
  116. REM Copy cmbins.exe to %_NTPostBld%
  117. REM
  118. copy /y %_NTPostBld%\cmbins\cmbins.exe %_NTPostBld%\cmbins.exe
  119. if errorlevel 1 (
  120. call errmsg.cmd "unable to copy %_NTPostBld%\cmbins\cmbins.exe to %_NTPostBld%\cmbins.exe"
  121. popd& goto :EOF
  122. )
  123. call logmsg.cmd "Cmbins.cmd completed successfully"
  124. popd