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.

158 lines
4.3 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. sub Usage { print<<USAGE; exit(1) }
  25. tscsetup.cmd (no params)
  26. contact: nadima
  27. Make msrdpcli.exe (Terminal Services Client setup file for CD install)
  28. USAGE
  29. parseargs('?' => \&Usage);
  30. # *** TEMPLATE CODE ***
  31. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  32. __END__
  33. @:CPCBegin
  34. @set _CPCMAGIC=
  35. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  36. @if not defined DEBUG echo off
  37. @REM *** CMD SCRIPT BELOW ***
  38. REM
  39. REM Generate msrdpcli.exe (only on i386)
  40. REM
  41. REM
  42. if not defined 386 (
  43. call logmsg.cmd "tscsetup.cmd do nothing on non i386"
  44. goto :EOF
  45. )
  46. if exist %_NTPostBld%\tsccab (
  47. call ExecuteCmd.cmd "rmdir /q /s %_NTPostBld%\tsccab"
  48. if errorlevel 1 call errmsg.cmd "err deleting tsccab dir"& goto :EOF
  49. )
  50. REM delete msrdpcli from root of the release directory here to avoid
  51. REM causing a popup on W2K OS build machines
  52. if exist %_NTPostBld%\msrdpcli.exe call ExecuteCmd.cmd "del /f %_NTPostBld%\msrdpcli.exe"
  53. if errorlevel 1 goto :EOF
  54. mkdir %_NTPostBld%\tsccab
  55. if errorlevel 1 call errmsg.cmd "err creating .\tsccab dir"& goto :EOF
  56. pushd %_NTPostBld%
  57. for %%i in (.\tscmsi01.w32 .\tscmsi02.w32 .\tscmsi03.w32 .\msrdpcli.sed .\instmsia.exe .\instmsiw.exe) do (
  58. if not exist %%i (
  59. call errmsg.cmd "File %_NTPostBld%\%%i not found."
  60. popd& goto :EOF
  61. )
  62. )
  63. REM
  64. REM This should only take a few seconds to complete
  65. REM
  66. :RunIt
  67. REM
  68. REM Create msrdpcli.exe.
  69. REM As iexpress.exe does not set errorlevel in all error cases,
  70. REM base verification on msrdpcli.exe's existence.
  71. REM
  72. REM
  73. REM copy files to temp cab dir and rename them back to their original names
  74. REM (the reverse of what mkrsys does)
  75. REM
  76. copy .\instmsia.exe .\tsccab\instmsia.exe
  77. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  78. copy .\instmsiw.exe .\tsccab\instmsiw.exe
  79. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  80. copy .\msrdpcli.sed .\tsccab\msrdpcli.sed
  81. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  82. copy .\tscmsi01.w32 .\tsccab\msrdpcli.msi
  83. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  84. copy .\tscmsi02.w32 .\tsccab\setup.exe
  85. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  86. copy .\tscmsi03.w32 .\tsccab\setup.ini
  87. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  88. pushd .\tsccab
  89. REM
  90. REM NOW in .\tsccab
  91. REM
  92. REM
  93. REM Munge the path so we use the correct wextract.exe to build the package with...
  94. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  95. REM
  96. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE%\loc\%LANG%
  97. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  98. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  99. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q msrdpcli.sed"
  100. REM
  101. REM Return the path to what it was before...
  102. REM
  103. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  104. if not exist msrdpcli.exe (
  105. call errmsg.cmd "iexpress.exe msrdpcli.sed failed."
  106. popd & popd& goto :EOF
  107. )
  108. REM
  109. REM Copy msrdpcli.exe to "retail"
  110. REM and support tools
  111. call ExecuteCmd.cmd "copy msrdpcli.exe ..\"
  112. if errorlevel 1 popd& popd & goto :EOF
  113. if not exist %_NTPostBld%\support\tools md %_NTPostBld%\support\tools
  114. call ExecuteCmd.cmd "copy msrdpcli.exe %_NTPostBld%\support\tools"
  115. if errorlevel 1 popd & popd & goto :EOF
  116. call logmsg.cmd "tscsetup.cmd completed successfully"
  117. popd & popd