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.

115 lines
3.5 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. sub Usage { print<<USAGE; exit(1) }
  20. CopyWow64 [-l <language>]
  21. Generates a list of files on a 64 bit machine to copy and copies them
  22. from the appropriate 32 bit machine to populate the tsclient install
  23. directories.
  24. USAGE
  25. parseargs('?' => \&Usage);
  26. # *** TEMPLATE CODE ***
  27. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  28. __END__
  29. @:CPCBegin
  30. @set _CPCMAGIC=
  31. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  32. @if not defined DEBUG echo off
  33. @REM *** CMD SCRIPT BELOW ***
  34. REM This script copies the x86 tsclient files to a 64 bit machine
  35. REM to populate the tsclient share directories.
  36. REM Contact: nadima
  37. REM ================================~START BODY~===============================
  38. REM Bail if your not on a 64 bit machine
  39. if /i "%_BuildArch%" neq "ia64" (
  40. if /i "%_BuildArch%" neq "amd64" (
  41. call logmsg.cmd "Not Win64, exiting."
  42. goto :End
  43. )
  44. )
  45. REM If you want to get your own x86 bits instead of those from
  46. REM your VBL, you have to set _NTWowBinsTree
  47. if defined _NTWowBinsTree (
  48. set SourceDir=%_NTWowBinsTree%
  49. goto :EndGetBuild
  50. )
  51. REM read the copy location from build_logs\CPLocation.txt
  52. set CPFile=%_NTPOSTBLD%\build_logs\CPLocation.txt
  53. if not exist %CPFile% (
  54. call logmsg.cmd "Copy Location file not found, will attempt to create ..."
  55. call %RazzleToolPath%\PostBuildScripts\CPLocation.cmd -l:%lang%
  56. if not exist %CPFile% (
  57. call errmsg.cmd "CPLocation.cmd failed, exiting ..."
  58. goto :End
  59. )
  60. )
  61. for /f "delims=" %%a in ('type %CPFile%') do set CPLocation=%%a
  62. if not exist %CPLocation% (
  63. call logmsg.cmd "Copy Location from %CPFile% does not exist, retry ..."
  64. call %RazzleToolPath%\PostBuildScripts\CPLocation.cmd -l:%lang%
  65. if not exist %CPFile% (
  66. call errmsg.cmd "CPLocation.cmd failed, exiting ..."
  67. goto :End
  68. )
  69. for /f "delims=" %%a in ('type %CPFile%') do set CPLocation=%%a
  70. if not exist !CPLocation! (
  71. call errmsg.cmd "Copy Location !CPLocation! does not exist ..."
  72. goto :End
  73. )
  74. )
  75. call logmsg.cmd "Copy Location for tsclient files is set to %CPLocation% ..."
  76. set SourceDir=%CPLocation%
  77. :EndGetBuild
  78. call logmsg.cmd "Using %SourceDir% as source directory for tsclient files..."
  79. if not exist %SourceDir% (
  80. call errmsg.cmd "The source dir %SourceDir% does not exist ..."
  81. goto :End
  82. )
  83. call logmsg.cmd "Copying files from %SourceDir%"
  84. REM Now perform the copy
  85. REM
  86. REM NOTE: We do the touch to ensure that the files have newer file
  87. REM stamps than the dummy 'idfile' placeholder as otherwise compression
  88. REM can fail to notice that the files have changed and we'll get the
  89. REM dummy files shipped on the release shares.
  90. REM
  91. for /f "tokens=1,2 delims=," %%a in (%RazzleToolPath%\PostBuildScripts\CopyTsc.txt) do (
  92. call ExecuteCmd.cmd "copy %SourceDir%\%%a %_NTPOSTBLD%\"
  93. call ExecuteCmd.cmd "touch %_NTPOSTBLD%\%%a"
  94. )
  95. goto end
  96. :end
  97. seterror.exe "%errors%"& goto :EOF