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.

228 lines
5.5 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM tscsetup.cmd - NadimA
  4. @REM Make an iexpress exe container (msrdpcli.exe) for all the tsc
  5. @REM client setup files. For installation from the support tools
  6. @REM section of the CD
  7. @REM
  8. @REM IMPORTANT: script must run after tsclient.cmd and msi.cmd complete
  9. @REM only runs on X86. On Win64 we cross-copy the x86 files.
  10. @REM
  11. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  12. @REM
  13. @REM -----------------------------------------------------------------
  14. @if NOT defined HOST_PROCESSOR_ARCHITECTURE set HOST_PROCESSOR_ARCHITECTURE=%PROCESSOR_ARCHITECTURE%
  15. @if defined _CPCMAGIC goto CPCBegin
  16. @perl -x "%~f0" %*
  17. @goto :EOF
  18. #!perl
  19. use strict;
  20. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  21. use lib $ENV{RAZZLETOOLPATH};
  22. use PbuildEnv;
  23. use ParseArgs;
  24. use Logmsg;
  25. sub Usage { print<<USAGE; exit(1) }
  26. tscsetup.cmd (no params)
  27. contact: nadima
  28. Make msrdpcli.exe (Terminal Services Client setup file for CD install)
  29. USAGE
  30. sub Dependencies {
  31. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  32. errmsg("Unable to open dependency list file.");
  33. die;
  34. }
  35. print DEPEND<<DEPENDENCIES;
  36. \[$0\]
  37. IF { msrdpcli.exe }
  38. ADD {
  39. tscmsi01.w32
  40. tscmsi02.w32
  41. tscmsi03.w32
  42. msrdpcli.sed
  43. instmsia.exe
  44. instmsiw.exe
  45. }
  46. DEPENDENCIES
  47. close DEPEND;
  48. exit;
  49. }
  50. my $qfe;
  51. parseargs('?' => \&Usage,
  52. 'plan' => \&Dependencies,
  53. 'qfe:' => \$qfe);
  54. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  55. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  56. errmsg("Unable to open skip list file.");
  57. die;
  58. }
  59. while (<SKIP>) {
  60. chomp;
  61. exit if lc$_ eq lc$0;
  62. }
  63. close SKIP;
  64. }
  65. # *** TEMPLATE CODE ***
  66. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  67. __END__
  68. @:CPCBegin
  69. @set _CPCMAGIC=
  70. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  71. @if not defined DEBUG echo off
  72. @REM *** CMD SCRIPT BELOW ***
  73. REM
  74. REM Generate msrdpcli.exe (only on i386)
  75. REM
  76. REM
  77. set _bla=1
  78. set _sbs=1
  79. set _srv=1
  80. set _ads=1
  81. set _dtc=1
  82. perl %RazzleToolPath%\cksku.pm -t:bla -l:%LANG%
  83. if errorlevel 1 set _bla=
  84. perl %RazzleToolPath%\cksku.pm -t:sbs -l:%LANG%
  85. if errorlevel 1 set _sbs=
  86. perl %RazzleToolPath%\cksku.pm -t:srv -l:%LANG%
  87. if errorlevel 1 set _srv=
  88. perl %RazzleToolPath%\cksku.pm -t:ads -l:%LANG%
  89. if errorlevel 1 set _ads=
  90. perl %RazzleToolPath%\cksku.pm -t:dtc -l:%LANG%
  91. if errorlevel 1 set _dtc=
  92. if defined _bla goto CONTINUE
  93. if defined _sbs goto CONTINUE
  94. if defined _srv goto CONTINUE
  95. if defined _ads goto CONTINUE
  96. if defined _dtc goto CONTINUE
  97. call logmsg.cmd "tscsetup.cmd do nothing on non server product"
  98. goto :EOF
  99. :CONTINUE
  100. if not defined 386 (
  101. call logmsg.cmd "tscsetup.cmd do nothing on non i386"
  102. goto :EOF
  103. )
  104. if exist %_NTPostBld%\tsccab (
  105. call ExecuteCmd.cmd "rmdir /q /s %_NTPostBld%\tsccab"
  106. if errorlevel 1 call errmsg.cmd "err deleting tsccab dir"& goto :EOF
  107. )
  108. REM delete msrdpcli from root of the release directory here to avoid
  109. REM causing a popup on W2K OS build machines
  110. if exist %_NTPostBld%\msrdpcli.exe call ExecuteCmd.cmd "del /f %_NTPostBld%\msrdpcli.exe"
  111. if errorlevel 1 goto :EOF
  112. mkdir %_NTPostBld%\tsccab
  113. if errorlevel 1 call errmsg.cmd "err creating .\tsccab dir"& goto :EOF
  114. pushd %_NTPostBld%
  115. for %%i in (.\tscmsi01.w32 .\tscmsi02.w32 .\tscmsi03.w32 .\msrdpcli.sed .\instmsia.exe .\instmsiw.exe) do (
  116. if not exist %%i (
  117. call errmsg.cmd "File %_NTPostBld%\%%i not found."
  118. popd& goto :EOF
  119. )
  120. )
  121. REM
  122. REM This should only take a few seconds to complete
  123. REM
  124. :RunIt
  125. REM
  126. REM Create msrdpcli.exe.
  127. REM As iexpress.exe does not set errorlevel in all error cases,
  128. REM base verification on msrdpcli.exe's existence.
  129. REM
  130. REM
  131. REM copy files to temp cab dir and rename them back to their original names
  132. REM (the reverse of what mkrsys does)
  133. REM
  134. copy .\instmsia.exe .\tsccab\instmsia.exe
  135. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  136. copy .\instmsiw.exe .\tsccab\instmsiw.exe
  137. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  138. copy .\msrdpcli.sed .\tsccab\msrdpcli.sed
  139. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  140. copy .\tscmsi01.w32 .\tsccab\msrdpcli.msi
  141. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  142. copy .\tscmsi02.w32 .\tsccab\setup.exe
  143. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  144. copy .\tscmsi03.w32 .\tsccab\setup.ini
  145. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  146. pushd .\tsccab
  147. REM
  148. REM NOW in .\tsccab
  149. REM
  150. REM
  151. REM Munge the path so we use the correct wextract.exe to build the package with...
  152. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  153. REM
  154. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE%\loc\%LANG%
  155. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  156. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  157. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q msrdpcli.sed"
  158. REM
  159. REM Return the path to what it was before...
  160. REM
  161. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  162. if not exist msrdpcli.exe (
  163. call errmsg.cmd "iexpress.exe msrdpcli.sed failed."
  164. popd & popd& goto :EOF
  165. )
  166. REM
  167. REM Copy msrdpcli.exe to "retail"
  168. REM and support tools
  169. call ExecuteCmd.cmd "copy msrdpcli.exe ..\"
  170. if errorlevel 1 popd& popd & goto :EOF
  171. if not exist %_NTPostBld%\support\tools md %_NTPostBld%\support\tools
  172. call ExecuteCmd.cmd "copy msrdpcli.exe %_NTPostBld%\support\tools"
  173. if errorlevel 1 popd & popd & goto :EOF
  174. call logmsg.cmd "tscsetup.cmd completed successfully"
  175. popd & popd