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.

174 lines
4.2 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM copytsc.cmd - NadimA
  4. @REM This script copies the x86 tsclient files to a 64 bit machine
  5. @REM to populate the tsclient install directories.
  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. use Logmsg;
  20. sub Usage { print<<USAGE; exit(1) }
  21. CopyWow64 [-l <language>]
  22. Generates a list of files on a 64 bit machine to copy and copies them
  23. from the appropriate 32 bit machine to populate the tsclient install
  24. directories.
  25. USAGE
  26. sub Dependencies {
  27. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  28. errmsg("Unable to open dependency list file.");
  29. die;
  30. }
  31. print DEPEND<<DEPENDENCIES;
  32. \[$0\]
  33. IF {
  34. msrdpcli.exe
  35. msrdpcli.msi
  36. mstsc.exe
  37. mstscax.dll
  38. mstsmhst.dll
  39. mstsmmc.dll
  40. tsmmc.msc
  41. tscupgrd.exe
  42. msrdp.cab
  43. tsweb1.htm
  44. mstsweb.cat
  45. tscmsi01.w32
  46. tscmsi02.w32
  47. tscmsi03.w32
  48. instmsia.exe
  49. instmsiw.exe
  50. }
  51. ADD {}
  52. DEPENDENCIES
  53. close DEPEND;
  54. exit;
  55. }
  56. my $qfe;
  57. parseargs('?' => \&Usage,
  58. 'plan' => \&Dependencies,
  59. 'qfe:' => \$qfe);
  60. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  61. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  62. errmsg("Unable to open skip list file.");
  63. die;
  64. }
  65. while (<SKIP>) {
  66. chomp;
  67. exit if lc$_ eq lc$0;
  68. }
  69. close SKIP;
  70. }
  71. # *** TEMPLATE CODE ***
  72. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  73. __END__
  74. @:CPCBegin
  75. @set _CPCMAGIC=
  76. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  77. @if not defined DEBUG echo off
  78. @REM *** CMD SCRIPT BELOW ***
  79. REM This script copies the x86 tsclient files to a 64 bit machine
  80. REM to populate the tsclient share directories.
  81. REM Contact: nadima
  82. REM ================================~START BODY~===============================
  83. REM Bail if your not on a 64 bit machine
  84. if /i "%_BuildArch%" neq "ia64" (
  85. if /i "%_BuildArch%" neq "amd64" (
  86. call logmsg.cmd "Not Win64, exiting."
  87. goto :End
  88. )
  89. )
  90. REM If you want to get your own x86 bits instead of those from
  91. REM your VBL, you have to set _NTTscBinsTREE
  92. if defined _NTTscBinsTREE (
  93. set SourceDir=%_NTTscBinsTREE%
  94. goto :EndGetBuild
  95. )
  96. REM figure out the copy location
  97. if not exist %_NTPostBld%\congeal_scripts\__qfenum__ (
  98. call errmsg.cmd "%_NTPostBld%\congeal_scripts\__qfenum__ does not exist"
  99. goto :End
  100. )
  101. for /f "tokens=1,2 delims==" %%a in (%_NTPostBld%\congeal_scripts\__qfenum__) do (
  102. if "%%a" == "QFEBUILDNUMBER" (
  103. set BuildNumber=%%b
  104. goto :GotNum
  105. )
  106. )
  107. :GotNum
  108. for /f "tokens=1,2 delims==" %%a in (%RazzleToolPath%\sp\xpsp1.ini) do (
  109. if /i "%%a" == "BuildMachine::x86::%_BuildType%::%lang%" (
  110. set BuildMachine=%%b
  111. goto :BuildMachine
  112. )
  113. )
  114. call errmsg "unable to find the buildMachine for x86%_BuildType% and lang %lang% in xpsp1.ini"
  115. :BuildMachine
  116. set SourceDir=\\%BuildMachine%\release\%BuildNumber%\%lang%\x86%_BuildType%\bin
  117. :waitForX86Share
  118. if not exist %SourceDir% (
  119. echo Waiting for x86 share -- %SourceDir% ......
  120. sleep 120
  121. goto :waitForX86Share
  122. )
  123. call logmsg.cmd "Copy Location for tsclient files is set to %SourceDir% ..."
  124. set SourceDir=%SourceDir%
  125. :EndGetBuild
  126. call logmsg.cmd "Using %SourceDir% as source directory for tsclient files..."
  127. if not exist %SourceDir% (
  128. call errmsg.cmd "The source dir %SourceDir% does not exist ..."
  129. goto :End
  130. )
  131. call logmsg.cmd "Copying files from %SourceDir%"
  132. REM Now perform the copy
  133. REM
  134. REM NOTE: We do the touch to ensure that the files have newer file
  135. REM stamps than the dummy 'idfile' placeholder as otherwise compression
  136. REM can fail to notice that the files have changed and we'll get the
  137. REM dummy files shipped on the release shares.
  138. REM
  139. for /f "tokens=1,2 delims=," %%a in (%RazzleToolPath%\sp\CopyTsc.txt) do (
  140. if exist %SourceDir%\%%a (
  141. call ExecuteCmd.cmd "copy %SourceDir%\%%a %_NTPOSTBLD%\"
  142. call ExecuteCmd.cmd "touch %_NTPOSTBLD%\%%a"
  143. )
  144. )
  145. goto end
  146. :end
  147. seterror.exe "%errors%"& goto :EOF