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.

235 lines
6.8 KiB

  1. @if "%_echo%"=="" echo off
  2. if "%1"=="-sku" (
  3. set SKU=%2
  4. shift /2
  5. ) else (
  6. set SKU=Server_32
  7. )
  8. set MODE=%1
  9. set ESE=%2
  10. if "%MODE%"=="" (
  11. set MODE=noask
  12. )
  13. if "%ESE"=="" (
  14. set ESE=default
  15. )
  16. if /i "%PROCESSOR_ARCHITECTURE%"=="ia64" (set PLATFORM_TYPE=ia64)
  17. if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (set PLATFORM_TYPE=i386)
  18. @rem
  19. @rem Let's copy binaries and data files into the required directories.
  20. @rem
  21. @rem
  22. set ESEROOT=%SDXROOT%\ds\ESE98
  23. set PCHEALTHROOT=%SDXROOT%\admin\pchealth
  24. set REDIST=%PCHEALTHROOT%\redist
  25. set PCHEALTHDEST=%WINDIR%\PCHealth\HelpCtr
  26. set UPLOADLBDEST=%WINDIR%\PCHealth\UploadLB
  27. @rem ################################################################################
  28. @rem ################################################################################
  29. @rem ################################################################################
  30. goto %SKU%
  31. :Personal_32
  32. set DATAFILE=pchdt_p3.cab
  33. set BUILDDIR=sku_per
  34. goto endsku
  35. :Professional_32
  36. set DATAFILE=pchdt_w3.cab
  37. set BUILDDIR=sku_wks
  38. goto endsku
  39. :Server_32
  40. set DATAFILE=pchdt_s3.cab
  41. set BUILDDIR=sku_srv
  42. goto endsku
  43. :Blade_32
  44. set DATAFILE=pchdt_b3.cab
  45. set BUILDDIR=sku_bld
  46. goto endsku
  47. :SmallBusinessServer_32
  48. set DATAFILE=pchdt_l3.cab
  49. set BUILDDIR=sku_sbs
  50. goto endsku
  51. :AdvancedServer_32
  52. set DATAFILE=pchdt_e3.cab
  53. set BUILDDIR=sku_ent
  54. goto endsku
  55. :DataCenter_32
  56. set DATAFILE=pchdt_d3.cab
  57. set BUILDDIR=sku_dtc
  58. goto endsku
  59. :Professional_64
  60. set DATAFILE=pchdt_w6.cab
  61. set BUILDDIR=sku_wks
  62. goto endsku
  63. :AdvancedServer_64
  64. set DATAFILE=pchdt_e6.cab
  65. set BUILDDIR=sku_ent
  66. goto endsku
  67. :DataCenter_64
  68. set DATAFILE=pchdt_d6.cab
  69. set BUILDDIR=sku_dtc
  70. goto endsku
  71. :endsku
  72. @rem ################################################################################
  73. @rem ################################################################################
  74. @rem ################################################################################
  75. net stop helpsvc
  76. net stop uploadmgr
  77. sleep 1
  78. kill -f helpctr.exe
  79. kill -f helpsvc.exe
  80. kill -f helphost.exe
  81. %PCHEALTHDEST%\Binaries\HelpSvc.exe /svchost netsvcs /unregserver >nul 2>nul
  82. %PCHEALTHDEST%\Binaries\HelpSvc.exe /svchost pchealth /unregserver >nul 2>nul
  83. %UPLOADLBDEST%\Binaries\UploadM.exe /svchost netsvcs /unregserver >nul 2>nul
  84. %UPLOADLBDEST%\Binaries\UploadM.exe /svchost pchealth /unregserver >nul 2>nul
  85. echo Removing previous version of the Help Center...
  86. if NOT exist %TEMP%\optfiles (md %TEMP%\optfiles) >nul
  87. if exist %PCHEALTHDEST%\binaries\*.opt (xcopy /q /y %PCHEALTHDEST%\binaries\*.opt %TEMP%\optfiles) >nul
  88. rd /s /q %PCHEALTHDEST% 2>nul >nul
  89. mkdir %PCHEALTHDEST% 2>nul >nul
  90. mkdir %PCHEALTHDEST%\Binaries 2>nul >nul
  91. if exist %TEMP%\optfiles\*.opt (xcopy /q /y %TEMP%\optfiles\*.opt %PCHEALTHDEST%\binaries) >nul
  92. if exist %TEMP%\optfiles (rd /s /q %TEMP%\optfiles) >nul
  93. echo Installing files for the Help Center...
  94. xcopy/R/Y %PCHEALTHROOT%\core\target\obj\%PLATFORM_TYPE%\atrace.dll %PCHEALTHDEST%\Binaries >nul
  95. xcopy/R/Y %PCHEALTHROOT%\core\target\obj\%PLATFORM_TYPE%\pchsvc.dll %PCHEALTHDEST%\Binaries >nul
  96. xcopy/R/Y %PCHEALTHROOT%\HelpCtr\target\obj\%PLATFORM_TYPE%\HCAppRes.dll %PCHEALTHDEST%\Binaries >nul
  97. xcopy/R/Y %PCHEALTHROOT%\PCHMars\target\obj\%PLATFORM_TYPE%\pchshell.* %PCHEALTHDEST%\Binaries >nul
  98. xcopy/R/Y %PCHEALTHROOT%\HelpCtr\target\obj\%PLATFORM_TYPE%\HelpCtr.* %PCHEALTHDEST%\Binaries >nul
  99. xcopy/R/Y %PCHEALTHROOT%\HelpCtr\target\obj\%PLATFORM_TYPE%\HelpSvc.* %PCHEALTHDEST%\Binaries >nul
  100. xcopy/R/Y %PCHEALTHROOT%\HelpCtr\target\obj\%PLATFORM_TYPE%\HelpHost.* %PCHEALTHDEST%\Binaries >nul
  101. xcopy/R/Y %PCHEALTHROOT%\HelpCtr\target\obj\%PLATFORM_TYPE%\RcImLby.exe %PCHEALTHDEST%\Binaries >nul
  102. echo Copying the database...
  103. if /i "%ESE%" EQU "ESE98" (
  104. xcopy/R/Y %ESEROOT%\src\ese\server\obj\%PLATFORM_TYPE%\esent.dll %PCHEALTHDEST%\Binaries >nul
  105. xcopy/R/Y %ESEROOT%\src\ese\server\obj\%PLATFORM_TYPE%\esent.pdb %PCHEALTHDEST%\Binaries >nul
  106. )
  107. del/q %TEMP%\createdb.log >nul 2>nul
  108. del/q %TEMP%\hss.log >nul 2>nul
  109. pushd %REDIST%\common
  110. build /3
  111. popd
  112. pushd %REDIST%\%BUILDDIR%
  113. build /3
  114. popd
  115. if not exist %_NTTREE%\HelpAndSupportServices\%DATAFILE% (
  116. echo "Setup image creation failed!! Look at %TEMP%\hss.log"
  117. goto end
  118. )
  119. copy %_NTTREE%\HelpAndSupportServices\%DATAFILE% %PCHEALTHDEST%\Binaries\%DATAFILE% >nul
  120. rem goto :end
  121. echo Registering programs...
  122. rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\svchost_config.inf
  123. regsvr32 /s %PCHEALTHDEST%\Binaries\HCApiSvr.dll
  124. %PCHEALTHDEST%\Binaries\HelpSvc.exe /install /svchost pchealth /regserver
  125. %PCHEALTHDEST%\Binaries\HelpHost.exe /regserver
  126. %PCHEALTHDEST%\Binaries\HelpCtr.exe /regserver
  127. pushd %PCHEALTHDEST%\Binaries
  128. rem RcImLby.exe -regserver
  129. popd
  130. cmd /c CopyPages
  131. @rem ################################################################################
  132. @rem ################################################################################
  133. @rem ################################################################################
  134. echo Reinstalling Upload Library...
  135. if NOT exist %TEMP%\optfiles (md %TEMP%\optfiles) >nul
  136. if exist %UPLOADLBDEST%\binaries\*.opt (xcopy /q /y %UPLOADLBDEST%\binaries\*.opt %TEMP%\optfiles) >nul
  137. rd /s /q %UPLOADLBDEST% 2>nul >nul
  138. mkdir %UPLOADLBDEST% >nul
  139. mkdir %UPLOADLBDEST%\Binaries >nul
  140. mkdir %UPLOADLBDEST%\Config >nul
  141. mkdir %UPLOADLBDEST%\Queue >nul
  142. if exist %TEMP%\optfiles\*.opt (xcopy /q /y %TEMP%\optfiles\*.opt %UPLOADLBDEST%\binaries) >nul
  143. if exist %TEMP%\optfiles (rd /s /q %TEMP%\optfiles) >nul
  144. xcopy/R/Y %PCHEALTHROOT%\core\target\obj\%PLATFORM_TYPE%\atrace.dll %UPLOADLBDEST%\Binaries >nul
  145. xcopy/R/Y %PCHEALTHROOT%\Upload\target\obj\%PLATFORM_TYPE%\UploadM.* %UPLOADLBDEST%\Binaries >nul
  146. xcopy/R/Y %PCHEALTHROOT%\HelpCtr\Content\config.xml %UPLOADLBDEST%\Config >nul
  147. xcopy/R/Y %PCHEALTHROOT%\HelpCtr\Content\pchealth.mof %UPLOADLBDEST%\Config >nul
  148. %UPLOADLBDEST%\Binaries\UploadM.exe /svchost pchealth /regserver
  149. if /i "%MODE%" EQU "regonly" (
  150. exit /B
  151. )
  152. @rem ################################################################################
  153. @rem ################################################################################
  154. @rem ################################################################################
  155. if /i "%MODE%" EQU "ask" (
  156. echo Press CTRL-C if you don't want to start the services right now.
  157. pause
  158. )
  159. net start helpsvc
  160. net start uploadmgr
  161. :end