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.

342 lines
11 KiB

  1. @echo off
  2. rem ************************** variables used ******************************
  3. rem %1 is file name
  4. set FileName=%1
  5. rem %2 is file path
  6. set FilePath=%2
  7. rem %3 is file type
  8. set FileType=%3
  9. rem %4 is Limited characters
  10. set LimitedChars=%4
  11. rem %5 is lc-file info
  12. set LcInfo=%5
  13. rem %8 is mirror property
  14. set Mirror=%8
  15. rem %6 bin name in loctree
  16. rem %7 bin path in loctree
  17. set LocTreePath=%7
  18. rem %9 bin path in loctree
  19. set LcBranch=%9
  20. rem ParserSettings is Parser settings
  21. set ParserSettings="Parser Options"
  22. if Not %_BuildArch%==ia64 (
  23. if %Filetype%==win64 goto :eof
  24. if %Filetype%==inf64 goto :eof
  25. )
  26. if /i %_BuildBranch%==main set PlocBuildBranch=main
  27. if /i %_BuildBranch%==srv03_rtm set PlocBuildBranch=main
  28. if %FileName%==badnt4.txt (
  29. set USInfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  30. if /i %PlocMode%==fe (
  31. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\jpn
  32. ) else if /i %PlocMode%==psu (
  33. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  34. ) else if /i %PlocMode%==mirror (
  35. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  36. ) else (
  37. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\%PlocMode%
  38. )
  39. goto skip_setupinfs
  40. )
  41. if %FileName%==badw2k.txt (
  42. set USInfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  43. if /i %PlocMode%==fe (
  44. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\jpn
  45. ) else if /i %PlocMode%==psu (
  46. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  47. ) else if /i %PlocMode%==mirror (
  48. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  49. ) else (
  50. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\%PlocMode%
  51. )
  52. goto skip_setupinfs
  53. )
  54. if %FileName%==printupg.txt (
  55. set USInfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  56. if /i %PlocMode%==fe (
  57. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\jpn
  58. ) else if /i %PlocMode%==psu (
  59. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  60. ) else if /i %PlocMode%==mirror (
  61. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  62. ) else (
  63. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\%PlocMode%
  64. )
  65. goto skip_setupinfs
  66. )
  67. if %FileName%==tsoc.txt (
  68. set USInfsPath=%SDXROOT%\termsrv\setup\inf\usa
  69. if /i %PlocMode%==fe (
  70. set InfsPath=%SDXROOT%\termsrv\setup\inf\jpn
  71. ) else if /i %PlocMode%==psu (
  72. set InfsPath=%SDXROOT%\termsrv\setup\inf\psu
  73. ) else if /i %PlocMode%==mirror (
  74. set InfsPath=%SDXROOT%\termsrv\setup\inf\ara
  75. ) else (
  76. set InfsPath=%SDXROOT%\termsrv\setup\inf\%PlocMode%
  77. )
  78. goto skip_setupinfs
  79. )
  80. if %FileName%==fxsocm.txt (
  81. set InfsPath=%SDXROOT%\printscan\faxsrv\setup\inf\usa
  82. goto skip_setupinfs
  83. )
  84. set USInfsPath=%SDXROOT%\MergedComponents\setupinfs\usa
  85. if /i %PlocMode%==fe (
  86. set InfsPath=%SDXROOT%\MergedComponents\setupinfs\jpn
  87. ) else if /i %PlocMode%==psu (
  88. set InfsPath=%SDXROOT%\MergedComponents\setupinfs\psu
  89. ) else if /i %PlocMode%==mirror (
  90. set InfsPath=%SDXROOT%\MergedComponents\setupinfs\ara
  91. ) else (
  92. set InfsPath=%SDXROOT%\MergedComponents\setupinfs\%PlocMode%
  93. )
  94. :skip_setupinfs
  95. if %Mirror%==yes_with (
  96. set Mirror=Yes
  97. )
  98. if %Mirror%==yes_without (
  99. set Mirror=No
  100. )
  101. rem **********************************************************
  102. rem %UniLimitedTable% is limited Unicode table
  103. rem %UniLimitedMethod% is limited Unicode method
  104. rem %PartialReplacementTable% is partial replacement table
  105. rem %PartialReplacementMethod% is partial replacement method
  106. rem %LimitedReplacementTable% is limited replacement table
  107. rem %LimitedReplacementMethod% is limited replacement method
  108. rem %LogFile% is log file
  109. rem %BinPath% is binary folder
  110. rem %LcPath% is lc folder
  111. rem %PLPFile% is PLP Config file
  112. rem %PlocMode% is pseudo localization mode
  113. rem %MakePloc% is variable used by makeploc.exe
  114. rem %PrivateLC% is a variable used by makeploc.exe
  115. rem **********************************************************
  116. rem *********************************Language Neutral section*********************************
  117. echo checking if this is a language Neutral binary
  118. set LcFileName=%FileName%.lc
  119. if exist %BinPath%\%FilePath%\%FileName%.mui (
  120. set FileName=%FileName%.mui
  121. )
  122. rem *******************************************************************************************
  123. rem ******************* Determining if file needs to be mirrored or not *********************
  124. rem skip files that don't need ploc for mirror mode
  125. if not %PlocMode%==mirror goto no_mirror
  126. if %Mirror%==no goto :eof
  127. if %Mirror%==excluded goto :eof
  128. :no_mirror
  129. rem *****************************************************************************************
  130. rem ******************* files not to localize ***********************************************
  131. if %FileType%==external goto :eof
  132. if %FileType%==notloc goto :eof
  133. if %FileType%==fe-file goto :eof
  134. if %FileType%==manual goto :eof
  135. if %FileType%==perf goto :eof
  136. if %FileType%==nobin goto :eof
  137. rem ********************************initialization section ***********************************
  138. if %LimitedChars%==unicode (
  139. set ReplacementTable=%UniReplacementTable%
  140. set ReplacementMethod=%UniReplacementMethod%
  141. )
  142. if %LimitedChars%==oem (
  143. set ReplacementTable=%LimitedReplacementTable%
  144. set ReplacementMethod=%LimitedReplacementMethod%
  145. )
  146. if %LimitedChars%==ansi (
  147. set ReplacementTable=%partialreplacementtable%
  148. set ReplacementMethod=%partialreplacementmethod%
  149. )
  150. if %LimitedChars%==unicode_limited (
  151. set ReplacementTable=%UniLimitedTable%
  152. set ReplacementMethod=%UniLimitedMethod%
  153. )
  154. if %FileType%==macintosh (
  155. set ReplacementTable=%MacReplacementTable%
  156. set ReplacementMethod=%MacReplacementMethod%
  157. )
  158. if %FileType%==win16 (
  159. set ReplacementTable=%PartialReplacementTable%
  160. if %plocmode%==932 (
  161. set ReplacementMethod=Matching
  162. ) else (
  163. set ReplacementMethod=%PartialReplacementMethod%
  164. )
  165. )
  166. if %FileType%==html (
  167. set ReplacementTable=%PartialReplacementTable%
  168. set ReplacementMethod=%PartialReplacementMethod%
  169. )
  170. if %FileType%==ipp (
  171. set ReplacementTable=%PartialReplacementTable%
  172. set ReplacementMethod=%PartialReplacementMethod%
  173. )
  174. rem **************** Special preprocessing *************************
  175. )
  176. if %FileType%==setup_inf (
  177. if not exist %InfsPath%\%FileName% goto not_exist
  178. )
  179. if NOT %FileType%==setup_inf (
  180. if not exist %BinPath%\%FilePath%\%FileName% goto not_exist
  181. )
  182. rem ******************** determine lc-file *************************
  183. if %PrivateLC%==yes goto lc_end
  184. set ComponentPath=%LcBranch%\ploc\%lcfolder%\.
  185. if %LcInfo%==. goto regular_lc
  186. set LcFile=%SDXROOT%\%ComponentPath%\%LcInfo%.lc
  187. goto lc_end
  188. :regular_lc
  189. if %_BuildArch%==ia64 goto ia64lcs
  190. set LcFile=%SDXROOT%\%ComponentPath%\%FilePath%\%LcFileName%
  191. goto lc_end
  192. :ia64lcs
  193. if EXIST %SDXROOT%\%ComponentPath%\%FilePath%\ia64\%LcFileName% (
  194. set LcFile=%SDXROOT%\%ComponentPath%\%FilePath%\ia64\%LcFileName%
  195. ) else (
  196. set LcFile=%SDXROOT%\%ComponentPath%\%FilePath%\%LcFileName%
  197. )
  198. :lc_end
  199. rem ****************************************************************
  200. rem *********************************** create resources (part 1) ************************************
  201. rem tokenize us file
  202. rem if not %PlocBuildBranch%==main goto no_tokenization1
  203. rem ////////skipping tokenization////////////
  204. if %Ustoken%==no goto no_tokenization1
  205. rem /////////////////////////////////////////
  206. if %FileType%==setup_inf goto setupinfstok
  207. if not exist %tmpBinPath%\resources\us\%FilePath% md %tmpBinPath%\resources\us\%FilePath%
  208. if %FileType%==xml goto xmltok1
  209. lccmd -i %InputLanguage% -t4 %BinPath%\%FilePath%\%FileName% %tmpBinPath%\resources\us\%FilePath%\%FileName%.tok > Nul
  210. pushd %BinPath%\%FilePath%
  211. for %%i in (%FileName%) do set RtfFileName=%%~ni
  212. if exist %RtfFileName%rtf rd %RtfFileName%rtf /q /s
  213. set RtfFileName=
  214. popd
  215. goto end_xmltok1
  216. :setupinfstok
  217. if not exist %tmpBinPath%\resources\us\%FilePath% md %tmpBinPath%\resources\us\%FilePath%
  218. lccmd -i %InputLanguage% -t4 %USInfsPath%\%FileName% %tmpBinPath%\resources\us\%FilePath%\%FileName%.tok > Nul
  219. goto end_xmltok1
  220. :xmltok1
  221. copy %tmpBinPath%\%FilePath%\%FileName% %tmpBinPath%\%FilePath%\%FileName%.xml
  222. lccmd -i %InputLanguage% -t4 %BinPath%\%FilePath%\%FileName%.xml %tmpBinPath%\resources\us\%FilePath%\%FileName%.tok > Nul
  223. del /q %tmpBinPath%\%FilePath%\%FileName%.xml
  224. :end_xmltok1
  225. :no_tokenization1
  226. rem copy lc-file
  227. if not exist %tmpBinPath%\resources\lcinf\%FilePath% md %tmpBinPath%\resources\lcinf\%FilePath%
  228. if exist %LcFile% copy /y %LcFile% %tmpBinPath%\resources\lcinf\%FilePath%\%LcFileName%
  229. rem ***************************************************************************************************
  230. rem ********************* create resources (part 2) ****************
  231. rem if not %PlocBuildBranch%==main goto no_tokenization2
  232. rem ////////skipping tokenization////////////
  233. rem goto no_tokenization2
  234. rem /////////////////////////////////////////
  235. if %PlocMode%==mirror goto no_tokenization2
  236. rem tokenize loc file
  237. if %FileType%==setup_inf (
  238. unitohex -a %InfsPath%\%FileName% %InfsPath%\%FileName%.tmp %LogFile%
  239. copy /y %InfsPath%\%FileName% %InfsPath%\%FileName%.loc
  240. copy /y %InfsPath%\%FileName%.tmp %InfsPath%\%FileName%
  241. if not exist %tmpBinPath%\resources\%Plocmode%\%FilePath% md %tmpBinPath%\resources\%Plocmode%\%FilePath%
  242. lccmd -i %OutputLanguage% -t4 %InfsPath%\%FileName% %tmpBinPath%\resources\%Plocmode%\%FilePath%\%FileName%.tok
  243. copy /y %InfsPath%\%FileName%.loc %InfsPath%\%FileName%
  244. del /q %InfsPath%\%FileName%.tmp
  245. del /q %InfsPath%\%FileName%.loc
  246. if not exist %tmpBinPath%\resources\merge\%FilePath% md %tmpBinPath%\resources\merge\%FilePath%
  247. mergetok %plocBinPath%\resources\us\%FilePath%\%FileName%.tok %tmpBinPath%\resources\%Plocmode%\%FilePath%\%FileName%.tok %tmpBinPath%\resources\merge\%FilePath%\%FileName%.tok
  248. goto end_xmltok2
  249. )
  250. if not exist %tmpBinPath%\resources\%Plocmode%\%FilePath% md %tmpBinPath%\resources\%Plocmode%\%FilePath%
  251. lccmd -i %OutputLanguage% -t4 %plocBinPath%\%FilePath%\%FileName% %tmpBinPath%\resources\%Plocmode%\%FilePath%\%FileName%.tok
  252. pushd %plocBinPath%\%FilePath%
  253. for %%i in (%FileName%) do set RtfFileName=%%~ni
  254. if exist %RtfFileName%rtf rd %RtfFileName%rtf /q /s
  255. set RtfFileName=
  256. popd
  257. :end_xmltok2
  258. rem create merged file
  259. if %PlocBuildBranch%==main (
  260. if not exist %tmpBinPath%\resources\merge\%FilePath% md %tmpBinPath%\resources\merge\%FilePath%
  261. mergetok %tmpBinPath%\resources\us\%FilePath%\%FileName%.tok %tmpBinPath%\resources\%Plocmode%\%FilePath%\%FileName%.tok %tmpBinPath%\resources\merge\%FilePath%\%FileName%.tok
  262. )
  263. :no_tokenization2
  264. :eof