Leaked source code of windows server 2003
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.

138 lines
2.8 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM MkNetfxCab.cmd - a-marias
  4. @REM Generate netfx.cab file.
  5. @REM
  6. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. @REM
  8. @REM -----------------------------------------------------------------
  9. @if defined _CPCMAGIC goto CPCBegin
  10. @perl -x "%~f0" %*
  11. @goto :EOF
  12. #!perl
  13. use strict;
  14. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  15. use lib $ENV{RAZZLETOOLPATH};
  16. use PbuildEnv;
  17. use ParseArgs;
  18. sub Usage { print<<USAGE; exit(1) }
  19. MkNetfxCab.cmd
  20. This sript creates netfx.cab. This cabinet contains files for netfx component.
  21. USAGE
  22. parseargs('?' => \&Usage);
  23. # *** TEMPLATE CODE ***
  24. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  25. __END__
  26. @:CPCBegin
  27. @set _CPCMAGIC=
  28. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  29. @if not defined DEBUG echo off
  30. @REM *** CMD SCRIPT BELOW ***
  31. @REM Only build this .cab for x86
  32. if not defined x86 goto :End
  33. call logmsg.cmd "MkNetfxCab: Start Netfx postbuild..."
  34. @REM
  35. @REM check that netfx.ddf is in %_NTPostBld%\netfx folder
  36. @REM
  37. if NOT DEFINED _NTPostBld (
  38. call errmsg.cmd "%%_NTPostBld%% is not defined."
  39. goto :End
  40. )
  41. if not exist %_NTPostBld%\netfx (
  42. call errmsg.cmd "Directory %_NTPostBld%\netfx not found."
  43. goto :End
  44. )
  45. set DdfFile=%_NTPostBld%\netfx\netfx.ddf
  46. if not exist %DdfFile% (
  47. call errmsg.cmd "File %DdfFile% not found."
  48. goto :End
  49. )
  50. pushd %_NTPostBld%\netfx
  51. REM
  52. REM Only run if relevant files changed
  53. REM
  54. if exist %_NtPostBld%\build_logs\bindiff.txt (
  55. for /f "skip=14 tokens=1 delims=" %%b in (netfx.ddf) do (
  56. findstr /ilc:%%b %_NTPostBld%\build_logs\bindiff.txt
  57. if /i "!ErrorLevel!" == "0" (
  58. call LogMsg.cmd "%%b changed - running cab generation"
  59. goto :RunIt
  60. )
  61. )
  62. call LogMsg.cmd "No relevant files changed - ending"
  63. goto :End
  64. )
  65. :RunIt
  66. @REM
  67. @REM Generate netfx.cab in %_NTPostBld%\netfx
  68. @REM
  69. set NetfxCabFile=%_NTPostBld%\netfx\netfx.cab
  70. if exist %NetfxCabFile% del /f %NetfxCabFile%
  71. call ExecuteCmd.cmd "makecab /f %DdfFile%"
  72. if errorlevel 1 (
  73. call errmsg.cmd "makecab failed on %DdfFile%. One or more files may be missing."
  74. goto :End
  75. )
  76. if not exist %NetfxCabFile% (
  77. call errmsg.cmd "makecab failed on %DdfFile%. One or more files may be missing."
  78. goto :End
  79. )
  80. @REM
  81. @REM Move netfx.cab from %_NTPostBld%\netfx to %_NTPostBld%
  82. @REM
  83. set NewNetfxCabFile=%_NTPostBld%\netfx.cab
  84. move /y %NetfxCabFile% %NewNetfxCabFile%
  85. if errorlevel 1 (
  86. call errmsg.cmd "Could not move %NetfxCabFile% to %_NTPostBld%"
  87. goto :End
  88. )
  89. if not exist %NewNetfxCabFile% (
  90. call errmsg.cmd "File %NewNetfxCabFile% not found."
  91. goto :End
  92. )
  93. @:End
  94. popd
  95. @endlocal