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.

167 lines
4.3 KiB

  1. @REM ----------------------------------------------------------------
  2. @REM
  3. @REM PbaInst.cmd - SumitC
  4. @REM Create an iexpress self-extracting EXE (PBAinst.exe) from the
  5. @REM files we've already copied to pbainst & subdirectories.
  6. @REM
  7. @REM Copyright 2001 (c) Microsoft Corporation. All rights reserved.
  8. @REM
  9. @REM ----------------------------------------------------------------
  10. @if NOT defined HOST_PROCESSOR_ARCHITECTURE set HOST_PROCESSOR_ARCHITECTURE=%PROCESSOR_ARCHITECTURE%
  11. @if defined _CPCMAGIC goto CPCBegin
  12. @perl -x "%~f0" %*
  13. @goto :EOF
  14. #!perl
  15. use strict;
  16. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  17. use lib $ENV{RAZZLETOOLPATH};
  18. use PbuildEnv;
  19. use ParseArgs;
  20. sub Usage { print<<USAGE; exit(1) }
  21. PbaInst.cmd [-l <language>]
  22. contact: SumitC or RCD
  23. Make PbaInst.exe (Phone Book Administrator app for ValueAdd)
  24. USAGE
  25. parseargs('?' => \&Usage);
  26. # *** TEMPLATE CODE ***
  27. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  28. __END__
  29. @:CPCBegin
  30. @set _CPCMAGIC=
  31. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  32. @if not defined DEBUG echo off
  33. @REM *** CMD SCRIPT BELOW ***
  34. REM
  35. REM PBA is localized for USA, GER, JPN, FR and ES.
  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. REM
  43. REM ...also, the PBA INF has strings that are localized.
  44. REM
  45. if /i "%lang%" equ "it" goto BuildPbainst
  46. if /i "%lang%" equ "sv" goto BuildPbainst
  47. if /i "%lang%" equ "nl" goto BuildPbainst
  48. if /i "%lang%" equ "br" goto BuildPbainst
  49. if /i "%lang%" equ "ru" goto BuildPbainst
  50. if /i "%lang%" equ "cs" goto BuildPbainst
  51. if /i "%lang%" equ "pl" goto BuildPbainst
  52. if /i "%lang%" equ "hu" goto BuildPbainst
  53. if /i "%lang%" equ "pt" goto BuildPbainst
  54. if /i "%lang%" equ "tr" goto BuildPbainst
  55. if /i "%lang%" equ "chs" goto BuildPbainst
  56. if /i "%lang%" equ "cht" goto BuildPbainst
  57. if /i "%lang%" equ "chh" goto BuildPbainst
  58. if /i "%lang%" equ "kor" goto BuildPbainst
  59. if /i "%lang%" equ "sv" goto BuildPbainst
  60. call logmsg.cmd "PBAINST is not applicable to language %lang%; exit."
  61. goto :EOF
  62. :BuildPbainst
  63. REM
  64. REM Check to see that all our files are present
  65. REM
  66. REM
  67. pushd %_NTPostBld%\pbainst
  68. for %%i in (
  69. .\pbainst.sed
  70. .\readme.htm
  71. .\sources0\comctl32.ocx
  72. .\sources0\comdlg32.ocx
  73. .\sources0\msinet.ocx
  74. .\sources0\pbadmin.hlp
  75. .\sources0\pbserver.mdb
  76. .\sources0\tabctl32.ocx
  77. .\sources1\base.ddf
  78. .\sources1\country.txt
  79. .\sources1\dta.bat
  80. .\sources1\dta.ddf
  81. .\sources1\empty_pb.mdb
  82. .\sources1\full.bat
  83. .\sources1\full.ddf
  84. .\sources1\hhwrap.dll
  85. .\sources1\pbadmin.exe
  86. .\sources1\pbasetup.exe
  87. .\sources1\pbasetup.inf
  88. ) do (
  89. if not exist %%i (
  90. call errmsg.cmd "File %_NTPostBld%\pbainst\%%i not found."
  91. popd& goto :EOF
  92. )
  93. )
  94. REM
  95. REM Create pbainst.exe.
  96. REM As iexpress.exe does not set errorlevel in all error cases,
  97. REM base verification on pbainst.exe's existence.
  98. REM
  99. if exist .\PbaInst.exe call ExecuteCmd.cmd "del /f PbaInst.exe"
  100. if errorlevel 1 goto :EOF
  101. REM
  102. REM Munge the path so we use the correct wextract.exe to build the package with...
  103. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  104. REM
  105. set _NEW_PATH_TO_PREPEND=%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE%\loc\%LANG%
  106. set _OLD_PATH_BEFORE_PREPENDING=%PATH%
  107. set PATH=%_NEW_PATH_TO_PREPEND%;%PATH%
  108. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q PbaInst.sed"
  109. REM
  110. REM Return the path to what it was before...
  111. REM
  112. set PATH=%_OLD_PATH_BEFORE_PREPENDING%
  113. if not exist PbaInst.exe (
  114. call errmsg.cmd "iexpress.exe PbaInst.sed failed."
  115. popd& goto :EOF
  116. )
  117. REM
  118. REM Copy PbaInst.exe and ReadMe.htm to ValueAdd directory
  119. REM
  120. if not exist %_NtPostBld%\ValueAdd\msft\mgmt\pba mkdir %_NtPostBld%\ValueAdd\msft\mgmt\pba
  121. if errorlevel 1 (
  122. call errmsg.cmd "mkdir %_NTPostBld%\ValueAdd\msft\mgmt\pba failed"
  123. popd& goto :EOF
  124. )
  125. for %%i in (.\PbaInst.exe .\ReadMe.htm) do (
  126. call ExecuteCmd.cmd "copy %%i %_NtPostBld%\ValueAdd\msft\mgmt\pba\."
  127. if errorlevel 1 popd& goto :EOF
  128. )
  129. call logmsg.cmd "PbaInst.cmd completed successfully"
  130. popd