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.

84 lines
1.9 KiB

  1. @ echo off
  2. @ REM ========================================================================
  3. @ REM Copyright (c) 1996 Microsoft Corporation
  4. @ REM
  5. @ REM Module Name:
  6. @ REM
  7. @ REM master.bat
  8. @ REM
  9. @ REM Abstract:
  10. @ REM
  11. @ REM Internet Express builds CDF files for building kits. Unfortunately,
  12. @ REM the devices and directories are hard-coded. This batch file runs
  13. @ REM the given CDF file through a bunch of SED Filters, producing a
  14. @ REM 'Master CDF' file that can be used from anyone's environment.
  15. @ REM
  16. @ REM Author:
  17. @ REM
  18. @ REM Doug Barlow (dbarlow) 3/26/1997
  19. @ REM
  20. @ REM ========================================================================
  21. setlocal
  22. @ REM
  23. @ REM Initialize the working variables.
  24. @ REM
  25. if "%1" == "" goto noInFile
  26. if not exist "%1%" goto badInFile
  27. set infile=%1
  28. if "%2" == "" goto noOutFile
  29. set outfile=%2
  30. set arch=
  31. if "%PROCESSOR_ARCHITECTURE%" == "x86" set arch=i386
  32. if "%PROCESSOR_ARCHITECTURE%" == "alpha" set arch=alpha
  33. if "%PROCESSOR_ARCHITECTURE%" == "mips" set arch=mips
  34. if "%PROCESSOR_ARCHITECTURE%" == "ppc" set arch=ppc
  35. if "%arch%" == "" goto noArchitecture
  36. set tdir=
  37. if "%NTDEBUG%" == "" goto noDebug
  38. if not "%NTDEBUG%" == "retail" set tdir=d
  39. set tdir=obj%tdir%
  40. set ntbindir=%_NTDRIVE%\%_NTROOT%
  41. @ REM
  42. @ REM Run the input file through the sed filters.
  43. @ REM
  44. sed -i -e s/%ntbindir%/{NTBINDIR}/g -e s/%tdir%/{DIR}/g -e s/%arch%/{ARCH}/g %infile% > %outfile%
  45. goto end
  46. @ REM
  47. @ REM Error processing.
  48. @ REM
  49. :noInfile
  50. echo ERROR: Supply a CDF file to convert.
  51. goto end
  52. :badInfile
  53. echo ERROR: Can't find source file '%1%'.
  54. goto end
  55. :noOutfile
  56. echo ERROR: Supply a Master File to create.
  57. goto end
  58. :noDebug
  59. echo ERROR: NTDEBUG is undefined.
  60. goto end
  61. :noArchitecture
  62. echo ERROR: PROCESSOR_ARCHITECTURE is unset or unrecognized.
  63. goto end
  64. :end
  65. endlocal