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.

238 lines
7.6 KiB

  1. @echo off
  2. rem -----------------------------------------------------------------------------
  3. rem Copyright (c) Microsoft Corporation 2001
  4. rem
  5. rem build_install.bat
  6. rem
  7. rem Batch script to build the client and server MSM and MSI installs for BITS.
  8. rem
  9. rem build_install.bat -s <vbl04|main|private> -t <target_path>
  10. rem
  11. rem -? Help.
  12. rem
  13. rem -s <loc> Specifies the location to get the BITS binaries from. The default is
  14. rem to get these from the VBL04 latest x86 release location. You currently
  15. rem have three choices: vbl04, main (ntdev\release) or private (local build).
  16. rem
  17. rem -S <loc> Use instead of -s if you want to specify a particular path.
  18. rem
  19. rem -t <path> Specifies the target path where the MSMs and MSIs will be placed after
  20. rem they are built.
  21. rem
  22. rem -c Only do the copy, don't rebuild the MSM/MSIs.
  23. rem
  24. rem Note:
  25. rem You must include InstallShield and Common Files\InstallShield in your
  26. rem path for this to work correctly. For example, the following (or equivalent)
  27. rem must be in your path for iscmdbld.exe to execute properly:
  28. rem
  29. rem c:\Program Files\Common Files\InstallShield
  30. rem c:\Program Files\InstallShield\Developer\System
  31. rem c:\Program Files\InstallShield\Professional - Windows Installer Edition\System
  32. rem -----------------------------------------------------------------------------
  33. set CurrentPath=%CD%
  34. set SourcePath="\\mgmtrel1\latest.tst.x86fre"
  35. set WinHttpPath="\\mgmtrel1\latest.tst.x86fre\asms\5100\msft\windows\winhttp"
  36. set WinHttpSymbolPath="\\mgmtrel1\latest.tst.x86fre\Symbols.pri\retail\dll"
  37. rem set WinHttpPath="\\ntdev\release\xpsp1\latest.tst\usa\x86fre\bin\winhttp.dll"
  38. rem set WinHttpSymbolPath="\\ntdev\release\xssp1\latest.tst\usa\x86fre\bin\symbols.pri\retail\dll\winhttp.pdb"
  39. set BinaryPath="bins\obj\i386"
  40. set SymbolPath=""
  41. set BuildMSIs="yes"
  42. set CopyBinaries="yes"
  43. set CopyWinhttp="yes"
  44. :ArgLoop
  45. if not "%1"=="" (
  46. if "%1"=="-s" (
  47. set SourceType="%2"
  48. if "%2"=="vbl04" (
  49. set SourcePath="\\mgmtrel1\latest.tst.x86fre"
  50. set SymbolPath="\\mgmtrel1\latest.tst.x86fre\Symbols.pri\retail\dll"
  51. )
  52. if "%2"=="main" (
  53. set SourcePath="\\ntdev\release\main\usa\latest.tst\x86fre\srv\i386"
  54. set WinHttpPath="\\ntdev\release\main\usa\latest.tst\x86fre\bin\asms\5100\msft\windows\winhttp"
  55. set SymbolPath="\\ntdev\release\main\usa\latest.idw\x86fre\sym\retail\dll"
  56. )
  57. if "%2"=="private" (
  58. set SourcePath="%CurrentPath%\bins\obj\i386"
  59. set SymbolPath="%CurrentPath%\bins\obj\i386"
  60. set CopyBinaries="no"
  61. )
  62. shift
  63. )
  64. if "%1"=="-c" (
  65. set BuildMSIs="no"
  66. )
  67. if "%1"=="-S" (
  68. set SourcePath=%2
  69. set SymbolPath=""
  70. )
  71. if "%1"=="-t" (
  72. set TargetDir=%2
  73. shift
  74. )
  75. shift
  76. goto ArgLoop
  77. )
  78. rem
  79. rem Copy binaries to bins\obj\*
  80. rem
  81. set FileList=bitsmgr.dll bitsoc.dll bitsprx2.dll bitssrv.dll qmgr.dll qmgrprxy.dll
  82. set PdbList=bitsmgr.pdb bitsoc.pdb bitsprx2.pdb bitssrv.pdb qmgr.pdb qmgrprxy.pdb
  83. set FileList_c=bitsmgr.dl_ bitsoc.dl_ bitsprx2.dl_ bitssrv.dl_ qmgr.dl_ qmgrprxy.dl_
  84. set PdbList_c=bitsmgr.pd_ bitsoc.pd_ bitsprx2.pd_ bitssrv.pd_ qmgr.pd_ qmgrprxy.pd_
  85. if %CopyWinhttp%=="yes" (
  86. echo
  87. echo ------------------- Get WinHttp Binary --------------------------------
  88. if exist %BinaryPath%\winhttp.dll (
  89. del %BinaryPath%\winhttp.dll
  90. )
  91. if exist %BinaryPath%\winhttp.pdb (
  92. del %BinaryPath%\winhttp.pdb
  93. )
  94. copy %WinHttpPath%\winhttp.dll %BinaryPath% || goto :eof
  95. copy %WinHttpSymbolPath%\winhttp.pdb %BinaryPath% || goto :eof
  96. )
  97. if %CopyBinaries%=="yes" (
  98. echo
  99. echo ------------------- Get BITS Binaries ---------------------------------
  100. echo SourcePath: %SourcePath%
  101. echo BinaryPath: %BinaryPath%
  102. if exist %SourcePath%\qmgr.dll (
  103. for %%f in (%FileList%) do (
  104. echo %%f
  105. if exist %BinaryPath%\%%f (
  106. del %BinaryPath%\%%f || goto :eof
  107. )
  108. copy %SourcePath%\%%f %BinaryPath% || goto :eof
  109. )
  110. for %%f in (%PdbList%) do (
  111. echo %%f
  112. if exist %BinaryPath%\%%f (
  113. del %BinaryPath%\%%f || goto :eof
  114. )
  115. copy %SymbolPath%\%%f %BinaryPath% || goto :eof
  116. )
  117. ) else if exist %SourcePath%\qmgr.dl_ (
  118. for %%f in (%FileList_c%) do (
  119. echo %%f
  120. if exist %BinaryPath%\%%f (
  121. del %BinaryPath%\%%f || goto :eof
  122. )
  123. copy %SourcePath%\%%f %BinaryPath% || goto :eof
  124. expand -r %BinaryPath%\%%f || goto :eof
  125. )
  126. for %%f in (%PdbList%) do (
  127. rem Note: PDBs are not currently compressed...
  128. echo %%f
  129. if exist %BinaryPath%\%%f (
  130. del %BinaryPath%\%%f || goto :eof
  131. )
  132. copy %SymbolPath%\%%f %BinaryPath% || goto :eof
  133. )
  134. ) else (
  135. echo "ERROR: No source files at: " %SourcePath%
  136. goto :eof
  137. )
  138. )
  139. rem
  140. rem Ok, build the MSM and MSIs
  141. rem
  142. echo
  143. echo ------------------- Clear MSM Cache -----------------------------------
  144. set MSMCache=%USERPROFILE%\My Documents\MySetups\MergeModules
  145. if exist %MSMCache%\BITS.MSM ( del %MSMCache%\BITS.MSM )
  146. if exist %MSMCache%\BITS_Server_Extensions.MSM ( del %MSMCache%\BITS_Server_Extensions.MSM )
  147. if exist %MSMCache%\WinHttp_v51.MSM ( del %MSMCache%\WinHttp_v51.MSM )
  148. if %BuildMSIs%=="yes" (
  149. echo
  150. echo ------------------- WinHttp MSM ---------------------------------------
  151. cd winhttp_msm
  152. call build_msm.bat %WinHttpPath% || goto :eof
  153. echo
  154. echo ------------------- BITS Client MSM -----------------------------------
  155. cd ..\bits_client_msm
  156. call build_msm.bat %SourcePath% || goto :eof
  157. echo
  158. echo ------------------- BITS Client MSI -----------------------------------
  159. cd ..\bits_client_msi
  160. call build_msi.bat %SourcePath% || goto :eof
  161. echo
  162. echo ------------------- BITS Server MSM/MSI -------------------------------
  163. cd ..\server-setup
  164. call build_install.bat %SourcePath% || goto :eof
  165. cd ..
  166. )
  167. rem
  168. rem Place the new MSMs and MSIs in the target directory
  169. rem
  170. echo
  171. echo ------------------- Copy Installs to %TargetDir% --------
  172. echo Target Direcotory is %TargetDir%
  173. if not exist %TargetDir% (md %TargetDir%)
  174. if not exist %TargetDir%\Client_MSM (md %TargetDir%\Client_MSM || goto :eof)
  175. xcopy /sfiderh "%CurrentPath%\bits_client_msm\Product Configuration 1\Release 1\diskimages\disk1" %TargetDir%\Client_MSM
  176. if not exist %TargetDir%\Client_MSI (md %TargetDir%\Client_MSI || goto :eof)
  177. xcopy /sfiderh "%CurrentPath%\bits_client_msi\Product Configuration 1\Release 1\diskimages\disk1" %TargetDir%\Client_MSI
  178. if not exist %TargetDir%\Server_MSM (md %TargetDir%\Server_MSM || goto :eof)
  179. xcopy /sfiderh "%CurrentPath%\server-setup\Server_MSM\Product Configuration 1\Release 1\diskimages\disk1" %TargetDir%\Server_MSM
  180. if not exist %TargetDir%\Server_MSI (md %TargetDir%\Server_MSI || goto :eof)
  181. xcopy /sfiderh "%CurrentPath%\server-setup\Server_MSI\Product Configuration 1\Release 1\diskimages\disk1" %TargetDir%\Server_MSI
  182. if not "%SymbolPath%"=="" (
  183. if not exist %TargetDir%\Symbols (md %TargetDir%\Symbols || goto :eof)
  184. for %%f in (%PdbList% winhttp.pdb) do (
  185. copy %BinaryPath%\%%f %TargetDir%\Symbols || goto :eof
  186. )
  187. )