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.

170 lines
3.6 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM deploytools.cmd - RyanBurk, JCohen
  4. @REM Creates the Whistler deployment cab
  5. @REM
  6. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. @REM
  8. @REM -----------------------------------------------------------------
  9. @if defined _CPCMAGIC goto CPCBegin
  10. @perl -x "%~f0" %*
  11. @goto :EOF
  12. #!perl
  13. use strict;
  14. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  15. use lib $ENV{RAZZLETOOLPATH};
  16. use PbuildEnv;
  17. use ParseArgs;
  18. use Logmsg;
  19. sub Usage { print<<USAGE; exit(1) }
  20. deploytools [-l <language>]
  21. Creates the Whistler deployment cab
  22. USAGE
  23. sub Dependencies {
  24. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  25. errmsg("Unable to open dependency list file.");
  26. die;
  27. }
  28. print DEPEND<<DEPENDENCIES;
  29. \[$0\]
  30. IF { support\\tools\\deploy.cab }
  31. ADD {
  32. opk\\tools\\...
  33. opk\\wizard\\...
  34. deploycab\\*
  35. opk\\docs\\*
  36. dump\\deploytools\\makefile.deploy
  37. }
  38. DEPENDENCIES
  39. close DEPEND;
  40. exit;
  41. }
  42. my $qfe;
  43. parseargs('?' => \&Usage,
  44. 'plan' => \&Dependencies,
  45. 'qfe:' => \$qfe);
  46. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  47. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  48. errmsg("Unable to open skip list file.");
  49. die;
  50. }
  51. while (<SKIP>) {
  52. chomp;
  53. exit if lc$_ eq lc$0;
  54. }
  55. close SKIP;
  56. }
  57. # *** TEMPLATE CODE ***
  58. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  59. __END__
  60. @:CPCBegin
  61. @set _CPCMAGIC=
  62. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  63. @if not defined DEBUG echo off
  64. @REM *** CMD SCRIPT BELOW ***
  65. REM
  66. REM Check for the working folder
  67. REM
  68. if NOT EXIST %_NTPostBld%\dump\deploytools (
  69. call errmsg.cmd "%_NTPostBld%\dump\deploytools does not exist; unable to create deploy.cab."
  70. goto :EOF
  71. )
  72. REM
  73. REM If there are old bits clean them.
  74. REM
  75. if EXIST %_NTPostBld%\dump\deploytools\obj (
  76. cd /d %_NTPostBld%\dump\deploytools
  77. if errorlevel 1 goto :EOF
  78. call ExecuteCmd.cmd "rd obj /s /q"
  79. if errorlevel 1 goto :EOF
  80. )
  81. REM
  82. REM rename the readme for the deploy.cab
  83. REM
  84. cd /d %_NTPostBld%\deploycab
  85. if errorlevel 1 (
  86. call errmsg.cmd "Unable to switch dirs (1), exiting"
  87. goto :EOF
  88. )
  89. call ExecuteCmd.cmd "copy readmed.txt readme.txt /y"
  90. if errorlevel 1 (
  91. call errmsg.cmd "Unable to copy readmed.txt, exiting"
  92. goto :EOF
  93. )
  94. REM --- WE DONT NEED TO DO THIS ANYMORE ---
  95. REM
  96. REM rename the ref.chm for the deploy.cab
  97. REM
  98. REM cd /d %_NTPostBld%\deploycab
  99. REM if errorlevel 1 (
  100. REM call errmsg.cmd "Unable to switch dirs (1), exiting"
  101. REM goto :EOF
  102. REM )
  103. REM
  104. REM call ExecuteCmd.cmd "copy ref_deploy.chm ref.chm /y"
  105. REM if errorlevel 1 (
  106. REM call errmsg.cmd "Unable to copy ref_deploy.chm, exiting"
  107. REM goto :EOF
  108. REM )
  109. REM
  110. REM Come back to the working folder and hit nmake to build the cabs
  111. REM
  112. cd /d %_NTPostBld%\dump\deploytools
  113. if errorlevel 1 (
  114. call errmsg.cmd "Unable to switch dirs (2), exiting"
  115. goto :EOF
  116. )
  117. call ExecuteCmd.cmd "nmake /F makefile.deploy"
  118. if errorlevel 1 (
  119. call errmsg.cmd "nmake /f failed, exiting"
  120. goto :EOF
  121. )
  122. REM
  123. REM Deployment Tools: Now %_NTPostBld%\support\tools is the working folder
  124. REM
  125. cd /d %_NTPostBld%\support\tools
  126. if errorlevel 1 (
  127. call errmsg.cmd "Unable to switch dirs (3), exiting"
  128. goto :EOF
  129. )
  130. pushd %_NTPostBld%\support\tools
  131. if errorlevel 1 (
  132. call errmsg.cmd "Pushd (tools) failed, exiting"
  133. goto :EOF
  134. )
  135. REM
  136. REM Deployment Tools: check whether the copy of the cabs have been successfull.
  137. REM
  138. if NOT exist deploy.cab (
  139. call errmsg.cmd "Unable to find deploy.cab."
  140. popd
  141. goto :EOF
  142. )
  143. call logmsg.cmd "Whistler Deployment Cabgen completed successfully."
  144. popd