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.

174 lines
4.3 KiB

  1. @echo off
  2. REM -----------------------------------------------------------------
  3. REM
  4. REM mkflpywinpe.cmd - mandarg ([email protected]) 14-March-2002
  5. REM Create the images for WinPE on LS-120 media
  6. REM If the number of boot floppies change make sure this script is
  7. REM updated to create the boot floppy tag file.
  8. REM
  9. REM This script creates a dummy directory at the base depending on
  10. REM the installation platform (I386, IA64, AMD64). This is required
  11. REM by the setup loader to load platform specific files.
  12. REM
  13. REM Copyright (c) Microsoft Corporation. All rights reserved.
  14. REM
  15. REM -----------------------------------------------------------------
  16. REM
  17. REM Set required variables.
  18. REM
  19. set SOURCEDIRECTORY=%1
  20. set DESTINATIONDRVLETTER=%2
  21. set EXCLUDELIST=%3
  22. set SHOWUSAGE=no
  23. set X86PLATEXT=I386
  24. set PLATEXT=%X86PLATEXT%
  25. if "%SOURCEDIRECTORY%" == "" (
  26. set SHOWUSAGE=yes
  27. ) else if "%DESTINATIONDRVLETTER%" == "" (
  28. set SHOWUSAGE=yes
  29. ) else if "%SOURCEDIRECTORY%" == "/?" (
  30. set SHOWUSAGE=yes
  31. ) else if "%EXCLUDELIST%" == "/?" (
  32. set SHOWUSAGE=yes
  33. )
  34. if /i "%SHOWUSAGE%" == "yes" (
  35. goto :showusage
  36. )
  37. REM
  38. REM Validate source directory.
  39. REM
  40. if not EXIST %SOURCEDIRECTORY% (
  41. goto :showusage
  42. )
  43. REM
  44. REM Determine if this is an IA64 WINPE or X86 WINPE.
  45. REM
  46. set X86SRCDIR=%SOURCEDIRECTORY%\I386
  47. set IA64SRCDIR=%SOURCEDIRECTORY%\IA64
  48. set AMD64SRCDIR=%SOURCEDIRECTORY%\AMD64
  49. if exist %IA64SRCDIR% (
  50. set PLATEXT=IA64
  51. ) else if exist %AMD64SRCDIR% (
  52. set PLATEXT=AMD64
  53. )else if not exist %X86SRCDIR% (
  54. goto :showusage
  55. )
  56. REM
  57. REM Set the destination from drive letter to <driveletter>:\MININT.
  58. REM
  59. set DESTINATIONROOT=%DESTINATIONDRVLETTER%:\
  60. set DESTINATION=%DESTINATIONROOT%\MININT
  61. set DESTDUMMYDIR=%DESTINATIONROOT%\%PLATEXT%
  62. REM
  63. REM Format the floppy.
  64. REM
  65. echo Formatting the floppy ...
  66. set DESTDRV=%DESTINATIONDRVLETTER%:
  67. format %DESTDRV% /Q
  68. if ERRORLEVEL 1 (
  69. echo Failed to format the floppy.
  70. goto :end
  71. )
  72. REM
  73. REM Make destination directory, i.e. <Drive>:\MININT
  74. REM Platform specific directory that setupldr uses to
  75. REM distinguish AMD64 from X86
  76. MD %DESTINATION%
  77. MD %DESTDUMMYDIR%
  78. if ERRORLEVEL 1 (
  79. echo Failed to create MININT directory on floppy.
  80. goto :end
  81. )
  82. REM
  83. REM copy over the minint files.
  84. REM
  85. echo Copying MININT files to the floppy ...
  86. xcopy %SOURCEDIRECTORY%\%PLATEXT%\*.* /s /y /f %DESTINATION% /EXCLUDE:%EXCLUDELIST%
  87. if ERRORLEVEL 1 (
  88. echo Failed to xcopy minint files.
  89. goto :end
  90. )
  91. REM
  92. REM Copy over the root files into the floppy
  93. REM X86 - setup loader, ntdetect.com, winbom.ini, tag files
  94. REM IA64 - setup loader, winbom.ini, tag files
  95. REM
  96. echo Copying boot files to the root....
  97. copy %SOURCEDIRECTORY%\%PLATEXT%\winbom.ini %DESTINATIONROOT%
  98. if ERRORLEVEL 1 (
  99. echo Failed to copy winbom.ini
  100. goto :end
  101. )
  102. if /i "%PLATEXT%" == "I386" (
  103. copy %SOURCEDIRECTORY%\%PLATEXT%\setupldr.bin %DESTINATIONROOT%ntldr
  104. if ERRORLEVEL 1 (
  105. echo Failed to copy setupldr as ntldr
  106. goto :end
  107. )
  108. copy %SOURCEDIRECTORY%\%PLATEXT%\ntdetect.com %DESTINATIONROOT%
  109. if ERRORLEVEL 1 (
  110. echo Failed to copy ntdetect.com
  111. goto :end
  112. )
  113. ) else if /i "%PLATEXT%" == "IA64" (
  114. copy %SOURCEDIRECTORY%\%PLATEXT%\setupldr.efi %DESTINATIONROOT%ntldr
  115. if ERRORLEVEL 1 (
  116. echo Failed to copy setupldr as ntldr
  117. goto :end
  118. )
  119. )
  120. REM
  121. REM Create boot floppy tag files.
  122. REM
  123. echo "" > %DESTINATIONROOT%\disk101
  124. echo "" > %DESTINATIONROOT%\disk102
  125. echo "" > %DESTINATIONROOT%\disk103
  126. echo "" > %DESTINATIONROOT%\disk104
  127. echo "" > %DESTINATIONROOT%\disk105
  128. echo "" > %DESTINATIONROOT%\disk106
  129. echo "" > %DESTINATIONROOT%\disk107
  130. goto :end
  131. :showusage
  132. echo Usage: mkflpywinpe.cmd [/?] SourceDir DestinationDrive ExcludeList
  133. echo.
  134. echo SourceDir : Drive letter to the Windows XP Professional CD
  135. echo or network path to a share pointing to the root of
  136. echo a WINPE share
  137. echo.
  138. echo DestinationDrive : Drive letter for the floppy where the image will be placed.
  139. echo
  140. echo ExcludeLisr : List of files to be excluded tobe copied into the floppy image.
  141. echo.
  142. echo Example: mkflpywinpe.cmd c:\winpe A exclude.txt
  143. echo.
  144. echo In this example, A: is the drive letter of the floppy we want to place the image in.
  145. echo named C:\Winpe is the directory that contains the WINPE image which needs to be placed on the floppy.
  146. echo.
  147. :end
  148. :end