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.

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