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.

140 lines
3.9 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM MoveBuild.cmd
  5. REM Move a build from binaries to the release tree
  6. REM
  7. REM Written by WadeLa
  8. REM
  9. REM Copyright (c) Microsoft Corporation. All rights reserved.
  10. REM
  11. REM ------------------------------------------------------------------
  12. if defined _CPCMAGIC goto CPCBegin
  13. perl -x "%~f0" %*
  14. @set RETURNVALUE=%errorlevel%
  15. @goto :endcmd
  16. #!perl
  17. use strict;
  18. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  19. use lib $ENV{RAZZLETOOLPATH};
  20. use PbuildEnv;
  21. use ParseArgs;
  22. sub Usage { print<<USAGE; exit(1) }
  23. Moves langusage specific tree under $ENV{_NTPostBld} to release or a release tree back to langauge directory under $ENV{_NTPostBld}
  24. movebuild [-n:build# | -qfe: qfe#] [-d:direction]
  25. -n:[buildnum] build number to move.
  26. -qfe:[qfe number]
  27. -d:[direction] either forward to release or back to binaries.
  28. USAGE
  29. parseargs('?' => \&Usage,
  30. 'n:' => \$ENV{mybuildnum},
  31. 'd:' => \$ENV{direction},
  32. 'qfe:' => \$ENV{qfe});
  33. # *** NEXT FEW LINES ARE TEMPLATE ***
  34. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  35. __END__
  36. :CPCBegin
  37. set _CPCMAGIC=
  38. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  39. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  40. if "%qfe%" == "" (
  41. if /i "%mybuildnum%" == "" (
  42. call errmsg.cmd "either specify the build number or the QFE number, exiting..."
  43. goto :EOF
  44. )
  45. )
  46. if /i "%direction%" == "" (
  47. call errmsg.cmd "No direction given, exiting..."
  48. goto :EOF
  49. )
  50. if "%qfe%" == "" (
  51. set RelPath=%_NTDRIVE%\release\%mybuildnum%\%lang%\%_buildarch%%_buildtype%
  52. ) else (
  53. set RelPath=%_NTDRIVE%\release\Q%qfe%\%_buildarch%%_buildtype%
  54. )
  55. if /i "%direction%" == "forward" goto :MoveForward
  56. if /i "%direction%" == "back" goto :MoveBack
  57. call errmsg.cmd "invalid direction, exiting..."
  58. goto :EOF
  59. :MoveForward
  60. if not exist %RelPath% (
  61. call executecmd.cmd "md %RelPath%"
  62. )
  63. if "%qfe%" == "" (
  64. if exist %RelPath%\bin (
  65. call errmsg.cmd "The release directory %RelPath%\bin already exists!"
  66. goto :EOF
  67. )
  68. call executecmd.cmd "move %_ntpostbld% %RelPath%\bin"
  69. call executecmd.cmd "move %RelPath%\bin\upd %RelPath%\upd"
  70. call executecmd.cmd "move %RelPath%\bin\slp %RelPath%\slp"
  71. call executecmd.cmd "move %RelPath%\bin\spcd %RelPath%\spcd"
  72. ) else (
  73. :wait1
  74. REM if not exist %RelPath%\bin_%lang% md %RelPath%\bin_%lang%
  75. REM call executecmd.cmd "move %_ntpostbld%\upd %RelPath%\bin_%lang%\upd"
  76. REM if not exist %RelPath%\bin_%lang%\wow6432 md %RelPath%\bin_%lang%\wow6432
  77. REM call executecmd.cmd "move %_ntpostbld%\wow6432 %RelPath%\bin_%lang%\wow6432"
  78. call executecmd.cmd "move /y %_ntpostbld%\Q%qfe%.exe %RelPath%\Q%qfe%_%lang%.exe"
  79. if /i "%LANG%" == "usa" (
  80. call executecmd.cmd "move %_ntpostbld%\upd %RelPath%\upd";
  81. )
  82. )
  83. goto :EOF
  84. :MoveBack
  85. if "%qfe%" == "" (
  86. if not exist %Relpath%\bin (
  87. call errmsg.cmd "No build in %RelPath%"
  88. goto :EOF
  89. )
  90. if exist %_NTPostBld% (
  91. call errmsg.cmd "The _NTPostBld directory %_NTPostBld% already exists!"
  92. goto :EOF
  93. )
  94. ) else (
  95. if not exist %Relpath%\Q%qfe%_%lang%.exe (
  96. call errmsg.cmd "No QFE to move back"
  97. goto :EOF
  98. )
  99. )
  100. if "%qfe%" == "" (
  101. call executecmd.cmd "move %RelPath%\bin %_NTPostBld%"
  102. call executecmd.cmd "move %RelPath%\upd %_NTPostBld%\upd"
  103. call executecmd.cmd "move %RelPath%\slp %_NTPostBld%\slp"
  104. call executecmd.cmd "move %RelPath%\spcd %_NTPostBld%\spcd"
  105. ) else (
  106. :wait2
  107. REM call executecmd.cmd "move %RelPath%\bin_%lang%\upd %_NTPostBld%"
  108. REM call executecmd.cmd "move %RelPath%\bin_%lang%\wow6432 %_NTPostBld%"
  109. call executecmd.cmd "move %RelPath%\Q%qfe%_%lang%.exe %_NTPostBld%\Q%qfe%.exe"
  110. if /i "%LANG%" == "usa" (
  111. call executecmd.cmd "move %RelPath%\upd %_ntpostbld%\upd";
  112. )
  113. )
  114. goto :EOF
  115. :endcmd
  116. @echo off
  117. if not defined seterror (
  118. set seterror=
  119. for %%a in ( seterror.exe ) do set seterror=%%~$PATH:a
  120. )
  121. @%seterror% %RETURNVALUE%