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.

145 lines
6.0 KiB

  1. @echo off
  2. if not "%_echo%" == "" echo on
  3. if not "%verbose%"=="" echo on
  4. REM If no drive has been specified for the NT development tree, assume
  5. REM C:. To override this, place a SET _NTDRIVE=X: in your CONFIG.SYS
  6. REM
  7. REM If we're called by a remote debugger window, %1 will be "DebugRemote"
  8. REM so set the environment and get rid of %1
  9. set DEBUG_REMOTE=
  10. if /i "%1" == "DebugRemote" set DEBUG_REMOTE=RemoteDebug&& shift
  11. if "%_NTDRIVE%" == "" set _NTDRIVE=C:
  12. if NOT "%USERNAME%" == "" goto skip1
  13. echo.
  14. echo !!! Error - USERNAME environment variable not set !!!
  15. echo.
  16. goto done
  17. :skip1
  18. REM This command file is either invoked by NTENV.CMD during the startup of
  19. REM a Razzle screen group, or it is invoked directly by a developer to
  20. REM switch developer environment variables on the fly. If invoked with
  21. REM no argument, it will restore the original developer's environment (as
  22. REM remembered by the NTENV.CMD command file). Otherwise the argument is
  23. REM a developer's email name and that developer's environment is established.
  24. if NOT "%1" == "" set USERNAME=%1
  25. if "%_NTUSER%" == "" goto skip2
  26. REM if invoked by a debug remote, don't set aliases that confuse the debugger
  27. if "%DEBUG_REMOTE%" == "RemoteDebug" goto skip2
  28. if "%1" == "" if "%USERNAME%" == "%_NTUSER%" alias src /d
  29. if "%1" == "" set USERNAME=%_NTUSER%
  30. :skip2
  31. REM Most tools look for .INI files in the INIT environment variable, so set
  32. REM it. MS WORD looks in MSWNET of all places.
  33. set INIT=%_NTBINDIR%\developer\%USERNAME%
  34. set MSWNET=%INIT%
  35. REM Load CUE with the standard public aliases and the developer's private ones
  36. if "%DEBUG_REMOTE%" == "RemoteDebug" goto skip4
  37. if "%_NTUSER%" == "" goto skip3
  38. REM Initialize user settable NT nmake environment variables
  39. set NTPROJECTS=public
  40. set NT386FLAGS=
  41. set NTCPPFLAGS=
  42. if "%NTDEBUG%" == "" set NTDEBUG=ntsd
  43. set BUILD_OPTIONS=
  44. set 386_OPTIMIZATION=
  45. set 386_WARNING_LEVEL=
  46. alias src > nul
  47. if NOT errorlevel 1 goto skip4
  48. @rem
  49. @rem Check if the user has a developr directory under root and let them know it won't
  50. @rem be used like it was in the old build (new name is developer with an 'e').
  51. @rem
  52. if NOT exist %_NTBINDIR%\developr goto LoadUserEnvironment
  53. echo WARNING: build now uses developer (with an 'e') for per user files
  54. :LoadUserEnvironment
  55. if exist %INIT%\cue.pri goto UsePrivateAliases
  56. echo %INIT%\cue.pri doesn't exist - only using public alias
  57. if EXIST %INIT%\dbg.pub alias -f %INIT%\dbg.pub
  58. alias -f %_NTBINDIR%\developer\cue.pub -f %_NTBINDIR%\developer\ntcue.pub
  59. alias -p remote.exe -f %_NTBINDIR%\developer\cue.pub -f %_NTBINDIR%\developer\ntcue.pub -f %_NTBINDIR%\developer\ntremote.pub
  60. goto skip4
  61. :UsePrivateAliases
  62. if EXIST %INIT%\dbg.pub alias -f %INIT%\dbg.pub
  63. alias -f %_NTBINDIR%\developer\cue.pub -f %_NTBINDIR%\developer\ntcue.pub -f %INIT%\cue.pri
  64. alias -p remote.exe -f %_NTBINDIR%\developer\cue.pub -f %_NTBINDIR%\developer\ntcue.pub -f %_NTBINDIR%\developer\ntremote.pub -f %INIT%\cue.pri
  65. goto skip4
  66. :skip3
  67. alias src > nul
  68. if errorlevel 1 goto skip4
  69. alias -f %_NTBINDIR%\developer\cue.pub -f %INIT%\cue.pri
  70. alias -p remote.exe -f %_NTBINDIR%\developer\cue.pub -f %_NTBINDIR%\developer\ntremote.pub -f %INIT%\cue.pri
  71. :skip4
  72. REM Load the developer's private environment initialization (keyboard rate,
  73. REM screen size, colors, environment variables, etc).
  74. REM Pass on "RemoteDebug" if ntuser.cmd was invoked by dbgntenv.cmd:
  75. if exist %INIT%\setenv.cmd goto UsePrivateSetenv
  76. if NOT exist %INIT% mkdir %INIT%
  77. echo REM>> %INIT%\setenv.cmd
  78. echo REM This is where you add your private build environment settings.>> %INIT%\setenv.cmd
  79. echo REM Usually, this only consists of your favorite editor settings.>> %INIT%\setenv.cmd
  80. echo REM>> %INIT%\setenv.cmd
  81. echo REM If you want source depot to use your editor for change pages (notepad is>> %INIT%\setenv.cmd
  82. echo REM the default), set the SDEDITOR macro to your editor name.>> %INIT%\setenv.cmd
  83. echo REM>> %INIT%\setenv.cmd
  84. echo REM You may have to add some entries to the path to find your editor.>> %INIT%\setenv.cmd
  85. echo REM>> %INIT%\setenv.cmd
  86. echo REM Note: Whatever you add to the path will have NO effect on the build>> %INIT%\setenv.cmd
  87. echo REM tools used when you call nmake or build in a razzle window.>> %INIT%\setenv.cmd
  88. echo REM>> %INIT%\setenv.cmd
  89. echo REM If you're tempted to put other stuff here to significantly modify the>> %INIT%\setenv.cmd
  90. echo REM build environment, first look at the what razzle does already.>> %INIT%\setenv.cmd
  91. echo REM>> %INIT%\setenv.cmd
  92. echo REM razzle help>> %INIT%\setenv.cmd
  93. echo REM >> %INIT%\setenv.cmd
  94. echo REM from a build window will show the current available options.>> %INIT%\setenv.cmd
  95. echo REM Hopefully your requirement is already there.>> %INIT%\setenv.cmd
  96. echo REM>> %INIT%\setenv.cmd
  97. echo REM When you're done editing this file, save it and exit. Then at>> %INIT%\setenv.cmd
  98. echo REM your earliest convience, add>> %INIT%\setenv.cmd
  99. echo REM %INIT%\setenv.cmd>> %INIT%\setenv.cmd
  100. echo REM to source control.>> %INIT%\setenv.cmd
  101. echo REM>> %INIT%\setenv.cmd
  102. echo REM If you have multiple machines, add another COMPUTERNAME test as below>> %INIT%\setenv.cmd
  103. echo REM>> %INIT%\setenv.cmd
  104. echo if "%%COMPUTERNAME%%" == "%ComputerName%" goto Do%ComputerName%>> %INIT%\setenv.cmd
  105. echo REM>> %INIT%\setenv.cmd
  106. echo echo %%COMPUTERNAME%% is unknown - Please update %%INIT%%\setenv.cmd>> %INIT%\setenv.cmd
  107. echo goto :eof>> %INIT%\setenv.cmd
  108. echo REM>> %INIT%\setenv.cmd
  109. echo :Do%ComputerName%>> %INIT%\setenv.cmd
  110. echo REM>> %INIT%\setenv.cmd
  111. echo REM *** Add your private environment settings for computer: %COMPUTERNAME% here ***>> %INIT%\setenv.cmd
  112. echo REM path=%%path%%;^<**Your path here**^> >> %INIT%\setenv.cmd
  113. echo REM set SDEDITOR=^<**Your editor name here**^> >> %INIT%\setenv.cmd
  114. echo REM>> %INIT%\setenv.cmd
  115. echo goto :eof>> %INIT%\setenv.cmd
  116. notepad %INIT%\setenv.cmd
  117. :UsePrivateSetenv
  118. call %INIT%\setenv.cmd %DEBUG_REMOTE%
  119. :done
  120. echo Current user is now %USERNAME%
  121. :end