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.

195 lines
5.4 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM tswebsetup.cmd - EltonS
  4. @REM Make an iexpress exe container (tswebsetup.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. tswebsetup.cmd (no params)
  26. contact: nadima
  27. Make tswebsetup.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 tswebsetup.exe (only on i386)
  40. REM
  41. REM
  42. set _bla=1
  43. set _sbs=1
  44. set _srv=1
  45. set _ads=1
  46. set _dtc=1
  47. perl %RazzleToolPath%\cksku.pm -t:bla -l:%LANG%
  48. if errorlevel 1 set _bla=
  49. perl %RazzleToolPath%\cksku.pm -t:sbs -l:%LANG%
  50. if errorlevel 1 set _sbs=
  51. perl %RazzleToolPath%\cksku.pm -t:srv -l:%LANG%
  52. if errorlevel 1 set _srv=
  53. perl %RazzleToolPath%\cksku.pm -t:ads -l:%LANG%
  54. if errorlevel 1 set _ads=
  55. perl %RazzleToolPath%\cksku.pm -t:dtc -l:%LANG%
  56. if errorlevel 1 set _dtc=
  57. if defined _bla goto CONTINUE
  58. if defined _sbs goto CONTINUE
  59. if defined _srv goto CONTINUE
  60. if defined _ads goto CONTINUE
  61. if defined _dtc goto CONTINUE
  62. call logmsg.cmd "tswebsetup.cmd do nothing on non server product"
  63. goto :EOF
  64. :CONTINUE
  65. if not defined 386 (
  66. call logmsg.cmd "tswebsetup.cmd do nothing on non i386"
  67. goto :EOF
  68. )
  69. if exist %_NTPostBld%\tsweb (
  70. call ExecuteCmd.cmd "rmdir /q /s %_NTPostBld%\tsweb"
  71. if errorlevel 1 call errmsg.cmd "err deleting tsweb dir"& goto :EOF
  72. )
  73. REM delete tswebsetup from root of the release directory here to avoid
  74. REM causing a popup on W2K OS build machines
  75. if exist %_NTPostBld%\tswebsetup.exe call ExecuteCmd.cmd "del /f %_NTPostBld%\tswebsetup.exe"
  76. if errorlevel 1 goto :EOF
  77. mkdir %_NTPostBld%\tsweb
  78. if errorlevel 1 call errmsg.cmd "err creating .\tsweb dir"& goto :EOF
  79. echo %_NTPostBld%
  80. pushd %_NTPostBld%
  81. for %%i in (tsweb-eula.txt tsweb-readme.htm tsweb-setup.inf tsweb-setup.sed tsweb1.htm msrdp.cab bluebarh.gif bluebarv.gif win2000l.gif Win2000r.gif) do (
  82. if not exist %%i (
  83. call errmsg.cmd "File %_NTPostBld%\%%i not found."
  84. popd& goto :EOF
  85. )
  86. )
  87. REM
  88. REM This should only take a few seconds to complete
  89. REM
  90. :RunIt
  91. REM
  92. REM Create tswebsetup.exe.
  93. REM As iexpress.exe does not set errorlevel in all error cases,
  94. REM base verification on tswebsetup.exe's existence.
  95. REM
  96. REM
  97. REM copy files to temp cab dir and rename them back to their original names
  98. REM (the reverse of what mkrsys does)
  99. REM
  100. copy .\tsweb-eula.txt .\tsweb\eula.txt
  101. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  102. copy .\tsweb-readme.htm .\tsweb\readme.htm
  103. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  104. copy .\tsweb-setup.inf .\tsweb\setup.inf
  105. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  106. copy .\tsweb-setup.sed .\tsweb\setup.sed
  107. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  108. copy .\tsweb1.htm .\tsweb\default.htm
  109. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  110. copy .\msrdp.cab .\tsweb\msrdp.cab
  111. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  112. copy .\bluebarh.gif .\tsweb\bluebarh.gif
  113. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  114. copy .\bluebarv.gif .\tsweb\bluebarv.gif
  115. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  116. copy .\win2000l.gif .\tsweb\win2000l.gif
  117. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  118. copy .\Win2000r.gif .\tsweb\Win2000r.gif
  119. if errorlevel 1 call errmsg.cmd "err copying files to .\tsweb"& goto :EOF
  120. pushd .\tsweb
  121. REM
  122. REM NOW in .\tsweb
  123. REM
  124. REM
  125. REM Munge the path so we use the correct wextract.exe to build the package with...
  126. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  127. REM
  128. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE%\loc\%LANG%
  129. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  130. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  131. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q setup.sed"
  132. REM
  133. REM Return the path to what it was before...
  134. REM
  135. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  136. if not exist tswebsetup.exe (
  137. call errmsg.cmd "iexpress.exe tswebsetup.sed failed."
  138. popd & popd& goto :EOF
  139. )
  140. REM
  141. REM Copy tswebsetup.exe to "retail"
  142. REM and support tools
  143. call ExecuteCmd.cmd "copy tswebsetup.exe ..\"
  144. if errorlevel 1 popd& popd & goto :EOF
  145. call logmsg.cmd "tswebsetup.cmd completed successfully"
  146. popd & popd