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.

160 lines
3.9 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM PbaInst.cmd
  5. REM Create an iexpress self-extracting EXE (PBAinst.exe) from the
  6. REM files we've already copied to pbainst & subdirectories.
  7. REM
  8. REM Copyright 2001 (c) Microsoft Corporation. All rights reserved.
  9. REM
  10. REM CONTACT: SumitC
  11. REM ------------------------------------------------------------------
  12. if defined _CPCMAGIC goto CPCBegin
  13. perl -x "%~f0" %*
  14. goto :EOF
  15. #!perl
  16. use strict;
  17. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  18. use lib $ENV{RAZZLETOOLPATH};
  19. use PbuildEnv;
  20. use ParseArgs;
  21. sub Usage { print<<USAGE; exit(1) }
  22. PbaInst.cmd [-l <language>]
  23. contact: SumitC or CmDev
  24. Make PbaInst.exe (Phone Book Administrator app for ValueAdd)
  25. USAGE
  26. parseargs('?' => \&Usage);
  27. # *** NEXT FEW LINES ARE TEMPLATE ***
  28. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  29. __END__
  30. :CPCBegin
  31. set _CPCMAGIC=
  32. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  33. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  34. REM
  35. REM Applicable to USA, GER, JPN, FR and ES only.
  36. REM
  37. if /i "%lang%" equ "usa" goto BuildPbainst
  38. if /i "%lang%" equ "jpn" goto BuildPbainst
  39. if /i "%lang%" equ "ger" goto BuildPbainst
  40. if /i "%lang%" equ "fr" goto BuildPbainst
  41. if /i "%lang%" equ "es" goto BuildPbainst
  42. call logmsg.cmd "PBAINST is not applicable to language %lang%; exit."
  43. goto :EOF
  44. :BuildPbainst
  45. REM
  46. REM Check to see that all our files are present
  47. REM
  48. REM
  49. pushd %_NTPostBld%\pbainst
  50. REM
  51. REM The CPS help file is built in a different VBL (lab06) so instead of
  52. REM having a copy checked into our branch, we get the most recent copy here.
  53. REM
  54. REM NOTE: I did this a little too early - Whistler Client help can't refer to
  55. REM whistler server because the name isn't finalized, so for now we actually
  56. REM *do* have to use a static cps_ops.chm. Once Whistler ships, we can
  57. REM enable this code to actually pick up the most recent helpfile.
  58. REM
  59. REM copy %_NTPostBld%\cps_ops.chm .\sources0\.
  60. for %%i in (
  61. .\pbainst.sed
  62. .\readme.htm
  63. .\sources0\comctl32.ocx
  64. .\sources0\comdlg32.ocx
  65. .\sources0\cps_ops.chm
  66. .\sources0\msinet.ocx
  67. .\sources0\pbadmin.hlp
  68. .\sources0\pbserver.mdb
  69. .\sources0\tabctl32.ocx
  70. .\sources1\base.ddf
  71. .\sources1\country.txt
  72. .\sources1\dta.bat
  73. .\sources1\dta.ddf
  74. .\sources1\empty_pb.mdb
  75. .\sources1\full.bat
  76. .\sources1\full.ddf
  77. .\sources1\hhwrap.dll
  78. .\sources1\pbadmin.exe
  79. .\sources1\pbasetup.exe
  80. .\sources1\pbasetup.inf
  81. ) do (
  82. if not exist %%i (
  83. call errmsg.cmd "File %_NTPostBld%\pbainst\%%i not found."
  84. popd& goto :EOF
  85. )
  86. )
  87. REM
  88. REM Create pbainst.exe.
  89. REM As iexpress.exe does not set errorlevel in all error cases,
  90. REM base verification on pbainst.exe's existence.
  91. REM
  92. if exist .\PbaInst.exe call ExecuteCmd.cmd "del /f PbaInst.exe"
  93. if errorlevel 1 goto :EOF
  94. REM
  95. REM Munge the path so we use the correct wextract.exe to build the package with...
  96. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  97. REM
  98. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\loc\%LANG%
  99. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  100. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  101. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q PbaInst.sed"
  102. REM
  103. REM Return the path to what it was before...
  104. REM
  105. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  106. if not exist PbaInst.exe (
  107. call errmsg.cmd "iexpress.exe PbaInst.sed failed."
  108. popd& goto :EOF
  109. )
  110. REM
  111. REM Copy PbaInst.exe and ReadMe.htm to ValueAdd directory
  112. REM
  113. if not exist %_NtPostBld%\ValueAdd\msft\mgmt\pba mkdir %_NtPostBld%\ValueAdd\msft\mgmt\pba
  114. if errorlevel 1 (
  115. call errmsg.cmd "mkdir %_NTPostBld%\ValueAdd\msft\mgmt\pba failed"
  116. popd& goto :EOF
  117. )
  118. for %%i in (.\PbaInst.exe .\ReadMe.htm) do (
  119. call ExecuteCmd.cmd "copy %%i %_NtPostBld%\ValueAdd\msft\mgmt\pba\."
  120. if errorlevel 1 popd& goto :EOF
  121. )
  122. call logmsg.cmd "PbaInst.cmd completed successfully"
  123. popd