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.

133 lines
2.9 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. sub Usage { print<<USAGE; exit(1) }
  19. deploytools [-l <language>]
  20. Creates the Whistler deployment cab
  21. USAGE
  22. parseargs('?' => \&Usage);
  23. # *** TEMPLATE CODE ***
  24. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  25. __END__
  26. @:CPCBegin
  27. @set _CPCMAGIC=
  28. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  29. @if not defined DEBUG echo off
  30. @REM *** CMD SCRIPT BELOW ***
  31. REM
  32. REM Check for the working folder
  33. REM
  34. if NOT EXIST %_NTPostBld%\dump\deploytools (
  35. call errmsg.cmd "%_NTPostBld%\dump\deploytools does not exist; unable to create deploy.cab."
  36. goto :EOF
  37. )
  38. REM
  39. REM If there are old bits clean them.
  40. REM
  41. if EXIST %_NTPostBld%\dump\deploytools\obj (
  42. cd /d %_NTPostBld%\dump\deploytools
  43. if errorlevel 1 goto :EOF
  44. call ExecuteCmd.cmd "rd obj /s /q"
  45. if errorlevel 1 goto :EOF
  46. )
  47. REM
  48. REM rename the readme for the deploy.cab
  49. REM
  50. cd /d %_NTPostBld%\deploycab
  51. if errorlevel 1 (
  52. call errmsg.cmd "Unable to switch dirs (1), exiting"
  53. goto :EOF
  54. )
  55. call ExecuteCmd.cmd "copy readmed.txt readme.txt /y"
  56. if errorlevel 1 (
  57. call errmsg.cmd "Unable to copy readmed.txt, exiting"
  58. goto :EOF
  59. )
  60. REM --- WE DONT NEED TO DO THIS ANYMORE ---
  61. REM
  62. REM rename the ref.chm for the deploy.cab
  63. REM
  64. REM cd /d %_NTPostBld%\deploycab
  65. REM if errorlevel 1 (
  66. REM call errmsg.cmd "Unable to switch dirs (1), exiting"
  67. REM goto :EOF
  68. REM )
  69. REM
  70. REM call ExecuteCmd.cmd "copy ref_deploy.chm ref.chm /y"
  71. REM if errorlevel 1 (
  72. REM call errmsg.cmd "Unable to copy ref_deploy.chm, exiting"
  73. REM goto :EOF
  74. REM )
  75. REM
  76. REM Come back to the working folder and hit nmake to build the cabs
  77. REM
  78. cd /d %_NTPostBld%\dump\deploytools
  79. if errorlevel 1 (
  80. call errmsg.cmd "Unable to switch dirs (2), exiting"
  81. goto :EOF
  82. )
  83. call ExecuteCmd.cmd "nmake /F makefile.deploy"
  84. if errorlevel 1 (
  85. call errmsg.cmd "nmake /f failed, exiting"
  86. goto :EOF
  87. )
  88. REM
  89. REM Deployment Tools: Now %_NTPostBld%\support\tools is the working folder
  90. REM
  91. cd /d %_NTPostBld%\support\tools
  92. if errorlevel 1 (
  93. call errmsg.cmd "Unable to switch dirs (3), exiting"
  94. goto :EOF
  95. )
  96. pushd %_NTPostBld%\support\tools
  97. if errorlevel 1 (
  98. call errmsg.cmd "Pushd (tools) failed, exiting"
  99. goto :EOF
  100. )
  101. REM
  102. REM Deployment Tools: check whether the copy of the cabs have been successfull.
  103. REM
  104. if NOT exist deploy.cab (
  105. call errmsg.cmd "Unable to find deploy.cab."
  106. popd
  107. goto :EOF
  108. )
  109. call logmsg.cmd "Whistler Deployment Cabgen completed successfully."
  110. popd