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.

65 lines
2.7 KiB

  1. @if "%_echo%"=="" echo off
  2. @rem
  3. @rem This script will take the checked in sd binaries (sdclient.exe and sdclient_win.exe)
  4. @rem and create sd.exe and sdwin.exe from them.
  5. @rem
  6. setlocal
  7. @rem Make sure sd.exe exists so xcopy will always work.
  8. if exist %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sd.exe goto UpdateSD
  9. copy %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdclient.exe %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sd.exe
  10. attrib +r %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sd.exe
  11. goto SD_Updated
  12. :UpdateSD
  13. @rem See if xcopy would have updated sdclient.exe over sd.exe
  14. for /f %%i in ('xcopy /ld %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdclient.exe %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sd.exe') do set _SDCHANGE=%%i
  15. if "%_SDCHANGE%" == "0" goto SD_Updated
  16. @rem Then do it (save the original as sdold.exe in case anyone needs to use it).
  17. del /f %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdold.exe
  18. ren %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sd.exe sdold.exe
  19. copy %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdclient.exe %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sd.exe
  20. attrib +r %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sd.exe
  21. :SD_Updated
  22. @rem Don't bother with sdwin for now. The new authentication scheme breaks it - BryanT/ChrisAnt 9/13/99
  23. if exist %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe del /f %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe
  24. if exist %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdold_win.exe del /f %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdold_win.exe
  25. goto SDWin_Updated
  26. @rem Same song, different verse. Update sdwin.exe using the same protocol.
  27. if exist %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe goto UpdateSDWin
  28. copy %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdclient_win.exe %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe
  29. attrib +r %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe
  30. goto SDWin_Updated
  31. :UpdateSDWin
  32. for /f %%i in ('xcopy /ld %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdclient_win.exe %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe') do set _SDWINCHANGE=%%i
  33. if "%_SDWINCHANGE%" == "0" goto SDWin_Updated
  34. del /f %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdold_win.exe
  35. ren %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe sdold_win.exe
  36. copy %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdclient_win.exe %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe
  37. attrib +r %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\sdwin.exe
  38. :SDWin_Updated
  39. @rem
  40. @rem INFRA is using new DNS alias names for the SD servers
  41. @rem maybe update the user's SD.INIs/SD.MAP
  42. @rem
  43. findstr /I coppermtn %SDXROOT%\sd.map >nul
  44. if "%ERRORLEVEL%" == "0" (
  45. sd -p margo:2001 sync %SDXROOT%\tools\projects.* %SDXROOT%\tools\sdx.* 2>NUL >NUL
  46. echo Updating SD.MAP/SD.INIs with new depot names...
  47. sdx repair -i -q 2>NUL >NUL
  48. )
  49. endlocal