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.

156 lines
3.9 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM tscsetup.cmd
  5. REM Make an iexpress exe container (msrdpcli.exe) for all the tsc
  6. REM client setup files. For installation from the support tools
  7. REM section of the CD
  8. REM
  9. REM IMPORTANT: script must run after tsclient.cmd and msi.cmd complete
  10. REM only runs on X86. On Win64 we cross-copy the x86 files.
  11. REM
  12. REM Copyright (c) Microsoft Corporation. All rights reserved.
  13. REM
  14. REM CONTACT: nadima
  15. REM ------------------------------------------------------------------
  16. if defined _CPCMAGIC goto CPCBegin
  17. perl -x "%~f0" %*
  18. goto :EOF
  19. #!perl
  20. use strict;
  21. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  22. use lib $ENV{RAZZLETOOLPATH};
  23. use PbuildEnv;
  24. use ParseArgs;
  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. parseargs('?' => \&Usage);
  31. # *** NEXT FEW LINES ARE TEMPLATE ***
  32. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  33. __END__
  34. :CPCBegin
  35. set _CPCMAGIC=
  36. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  37. REM *** BEGIN YOUR 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. mkdir %_NTPostBld%\tsccab
  51. if errorlevel 1 call errmsg.cmd "err creating .\tsccab dir"& goto :EOF
  52. pushd %_NTPostBld%
  53. for %%i in (.\tscmsi01.w32 .\tscmsi02.w32 .\tscmsi03.w32 .\msrdpcli.sed .\instmsia.exe .\instmsiw.exe) do (
  54. if not exist %%i (
  55. call errmsg.cmd "File %_NTPostBld%\%%i not found."
  56. popd& goto :EOF
  57. )
  58. )
  59. REM
  60. REM This should only take a few seconds to complete
  61. REM
  62. :RunIt
  63. REM
  64. REM Create msrdpcli.exe.
  65. REM As iexpress.exe does not set errorlevel in all error cases,
  66. REM base verification on msrdpcli.exe's existence.
  67. REM
  68. if exist msrdpcli.exe call ExecuteCmd.cmd "del /f msrdpcli.exe"
  69. if errorlevel 1 goto :EOF
  70. REM
  71. REM copy files to temp cab dir and rename them back to their original names
  72. REM (the reverse of what mkrsys does)
  73. REM
  74. copy .\instmsia.exe .\tsccab\instmsia.exe
  75. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  76. copy .\instmsiw.exe .\tsccab\instmsiw.exe
  77. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  78. copy .\msrdpcli.sed .\tsccab\msrdpcli.sed
  79. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  80. copy .\tscmsi01.w32 .\tsccab\msrdpcli.msi
  81. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  82. copy .\tscmsi02.w32 .\tsccab\setup.exe
  83. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  84. copy .\tscmsi03.w32 .\tsccab\setup.ini
  85. if errorlevel 1 call errmsg.cmd "err copying files to .\tsccab"& goto :EOF
  86. pushd .\tsccab
  87. REM
  88. REM NOW in .\tsccab
  89. REM
  90. REM
  91. REM Munge the path so we use the correct wextract.exe to build the package with...
  92. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  93. REM
  94. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\loc\%LANG%
  95. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  96. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  97. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q msrdpcli.sed"
  98. REM
  99. REM Return the path to what it was before...
  100. REM
  101. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  102. if not exist msrdpcli.exe (
  103. call errmsg.cmd "iexpress.exe msrdpcli.sed failed."
  104. popd & popd& goto :EOF
  105. )
  106. REM
  107. REM Copy msrdpcli.exe to "retail"
  108. REM and support tools
  109. call ExecuteCmd.cmd "copy msrdpcli.exe ..\"
  110. if errorlevel 1 popd& popd & goto :EOF
  111. if not exist %_NTPostBld%\support\tools md %_NTPostBld%\support\tools
  112. call ExecuteCmd.cmd "copy msrdpcli.exe %_NTPostBld%\support\tools"
  113. if errorlevel 1 popd & popd & goto :EOF
  114. call logmsg.cmd "tscsetup.cmd completed successfully"
  115. popd & popd