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.

91 lines
2.7 KiB

  1. REM ------------------------------------------------------------------
  2. REM
  3. REM sxs_generate_msm.cmd
  4. REM Generates msms for assembly which provide componentID as well
  5. REM as ModuleID
  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. sxs_generate_msm
  21. Generate Msi Merge Module for Side-By-Side win32 assemblies
  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. set BINPLACE_LOG=%BINPLACE_LOG%_sxs_msm.cmd.log
  32. set in=%BINPLACE_LOG%\..\sxsMsmList*.txt
  33. REM
  34. REM if sxsMsmList.txt does not exist or empty, it means no requirement to generate merge module,
  35. REM just goto :eof
  36. REM
  37. if not EXIST %in% (
  38. call logmsg.cmd "no merge module generation requirement!"
  39. goto :eof
  40. )
  41. REM
  42. REM sort.exe|unique.exe the msm-request logfile generated by makefile.def,
  43. REM and pretty print the content as readable columns.
  44. REM
  45. set out=%BINPLACE_LOG%\..\combined_sxsMsmList.txt
  46. if EXIST %out% del /f /q %out%
  47. echo>>%out% ;"%in% is produced by SXS_LOG in makefile.def"
  48. echo>>%out% ;"then %in% processed by perl | columns.exe | sort.exe | unique.exe in %0 to produce %out%"
  49. echo>>%out% ;"MSM-ModuleGUID | MSM Filename| Assembly-Source-Location | MSM-ComponentGUID"
  50. echo>>%out% ;============================================================================================
  51. call logmsg.cmd "start perl | columns.exe | sort.exe | unique.exe"
  52. type %in% | columns.exe | sort.exe | unique.exe > %out%
  53. call logmsg.cmd "end perl | columns.exe | sort.exe | unique.exe"
  54. REM
  55. REM for each entry in the combined logfile, call sxs_msmgen.exe to generate msm
  56. REM and put it into the specified destination path
  57. REM
  58. set TempWorkingDir=%RANDOM%
  59. md %_NTPOSTBLD%\!TempWorkingDir!
  60. pushd %_NTPOSTBLD%\!TempWorkingDir!
  61. if "!errorlevel!" == "1" (
  62. call errmsg.cmd "cd /d %%_NTPOSTBLD%% failed! from sxs_msm.cmd"
  63. goto :EOF
  64. )
  65. set sxs_msmgen_cmd=sxs_msmgen.exe mangroup %out% -template %RazzleToolPath%\sxs_msmgen.msm
  66. call logmsg.cmd "Generating merge module for Side-By-Side Win32 Assemblies"
  67. call ExecuteCmd.cmd "%%sxs_msmgen_cmd%%"
  68. if "!errorlevel!" == "1" (
  69. call errmsg.cmd "Generate msm failed for %%_NTPOSTBLD%%\%%i"
  70. goto :Eof
  71. )
  72. :Eof
  73. popd
  74. rmdir /s /q %_NTPOSTBLD%\!TempWorkingDir!