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.

152 lines
4.4 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM winnt32msi.cmd
  5. REM updates the checked in version of winnt32.msi with current
  6. REM build and SKU info
  7. REM
  8. REM Copyright (c) Microsoft Corporation. All rights reserved.
  9. REM
  10. REM ------------------------------------------------------------------
  11. if defined _CPCMAGIC goto CPCBegin
  12. perl -x "%~f0" %*
  13. goto :EOF
  14. #!perl
  15. use strict;
  16. use lib $ENV{RAZZLETOOLPATH} . "\\postbuildscripts";
  17. use lib $ENV{RAZZLETOOLPATH};
  18. use PbuildEnv;
  19. use ParseArgs;
  20. use Logmsg;
  21. sub Usage { print<<USAGE; exit(1) }
  22. winnt32msi
  23. Generate the winnt32.msi for different SKUs
  24. USAGE
  25. sub Dependencies {
  26. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  27. errmsg("Unable to open dependency list file.");
  28. die;
  29. }
  30. print DEPEND<<DEPENDENCIES;
  31. \[$0\]
  32. IF {
  33. winnt32.msi
  34. } ADD {
  35. congeal_scripts\\setupmsi\\...
  36. }
  37. DEPENDENCIES
  38. close DEPEND;
  39. exit;
  40. }
  41. my $qfe;
  42. parseargs('?' => \&Usage,
  43. 'plan' => \&Dependencies,
  44. 'qfe:' => \$qfe);
  45. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  46. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  47. errmsg("Unable to open skip list file.");
  48. die;
  49. }
  50. while (<SKIP>) {
  51. chomp;
  52. exit if lc$_ eq lc$0;
  53. }
  54. close SKIP;
  55. }
  56. # *** NEXT FEW LINES ARE TEMPLATE ***
  57. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  58. __END__
  59. :CPCBegin
  60. set _CPCMAGIC=
  61. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  62. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  63. call logmsg.cmd /t "Starting winnt32msi.cmd"
  64. if not exist %_NTPostBld%\congeal_scripts\setupmsi (
  65. call logmsg.cmd "Missing %_NTPostBld%\congeal_scripts\setupmsi directory, must not need to build it, exiting"
  66. popd & goto :EOF
  67. )
  68. pushd %_NTPostBld%\congeal_scripts\setupmsi
  69. if not exist %_NTPostBld%\congeal_scripts\setupmsi\winnt32.msi (
  70. call logmsg.cmd "Missing %_NTPostBld%\congeal_scripts\setupmsi\winnt32.msi, must not need to build it, exiting"
  71. popd & goto :EOF
  72. )
  73. REM
  74. REM Examine the congeal_scripts\setupmsi directory and launch tagmsi for all flavors
  75. REM RYANBURK: since this is XP SP, do this only for PRO and PER
  76. REM
  77. set prods=
  78. set prods=pro per
  79. REM perl %RazzleToolPath%\cksku.pm -t:pro -l:%lang%
  80. REM if %errorlevel% EQU 0 (set prods=%prods% pro)
  81. REM perl %RazzleToolPath%\cksku.pm -t:per -l:%lang%
  82. REM if %errorlevel% EQU 0 (set prods=%prods% per)
  83. REM perl %RazzleToolPath%\cksku.pm -t:bla -l:%lang%
  84. REM if %errorlevel% EQU 0 (set prods=%prods% bla)
  85. REM perl %RazzleToolPath%\cksku.pm -t:sbs -l:%lang%
  86. REM if %errorlevel% EQU 0 (set prods=%prods% sbs)
  87. REM perl %RazzleToolPath%\cksku.pm -t:srv -l:%lang%
  88. REM if %errorlevel% EQU 0 (set prods=%prods% srv)
  89. REM perl %RazzleToolPath%\cksku.pm -t:ads -l:%lang%
  90. REM if %errorlevel% EQU 0 (set prods=%prods% ent)
  91. REM perl %RazzleToolPath%\cksku.pm -t:dtc -l:%lang%
  92. REM if %errorlevel% EQU 0 (set prods=%prods% dtc)
  93. set msidir=%_NTPostBld%\congeal_scripts\setupmsi
  94. set scriptdir=%sdxroot%\tools\sp
  95. for %%i in (%prods%) do (
  96. if not exist %_NTPostBld%\congeal_scripts\setupmsi\%%iinfo.txt (
  97. call errmsg.cmd "Missing %%iinfo.txt, needed for build"
  98. popd & goto :EOF
  99. )
  100. call ExecuteCmd.cmd "if not exist %_NTPostBld%\%%iinf md %_NTPostBld%\%%iinf"
  101. if "%%i" == "pro" (
  102. call %sdxroot%\tools\sp\tagmsi.cmd %msidir%\winnt32.msi %scriptdir% %_NTPostBld%\winnt32.msi %msidir%\%%iinfo.txt %lang%
  103. if errorlevel 1 (
  104. call errmsg.cmd "%sdxroot%\tools\sp\tagmsi.cmd %msidir%\winnt32.msi %scriptdir% %_NTPostBld%\winnt32.msi %msidir%\%%iinfo.txt %lang% failed"
  105. popd & goto :EOF
  106. )
  107. ) else (
  108. call %sdxroot%\tools\sp\tagmsi.cmd %msidir%\winnt32.msi %scriptdir% %_NTPostBld%\%%iinf\winnt32.msi %msidir%\%%iinfo.txt %lang%
  109. echo %errorlevel%
  110. if errorlevel 1 (
  111. call errmsg.cmd "%sdxroot%\tools\sp\tagmsi.cmd %msidir%\winnt32.msi %scriptdir% %_NTPostBld%\%%iinf\winnt32.msi %msidir%\%%iinfo.txt %lang% failed"
  112. popd & goto :EOF
  113. )
  114. )
  115. if errorlevel 1 (
  116. call errmsg.cmd "%sdxroot%\tools\sp\tagmsi.cmd %msidir%\winnt32.msi %scriptdir% %_NTPostBld%\%%iinf\winnt32.msi %msidir%\%%iinfo.txt %lang% failed"
  117. popd & goto :EOF
  118. )
  119. )
  120. call logmsg.cmd /t "Successfully completed winnt32msi.cmd"