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.

766 lines
31 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. set PlocBuildBranch=Lab
  27. if /i %_BuildBranch%==main set PlocBuildBranch=main
  28. if /i %_BuildBranch%==srv03_rtm set PlocBuildBranch=main
  29. if %FileName%==badnt4.txt (
  30. if %PlocMode%==932 (
  31. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\jpn
  32. )
  33. if %PlocMode%==1250 (
  34. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  35. )
  36. if %PlocMode%==mirror (
  37. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  38. )
  39. goto skip_setupinfs
  40. )
  41. if %FileName%==badw2k.txt (
  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. if %PlocMode%==932 (
  55. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\jpn
  56. )
  57. if %PlocMode%==1250 (
  58. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  59. )
  60. if %PlocMode%==mirror (
  61. set InfsPath=%SDXROOT%\printscan\print\drivers\binaries\fixprnsv\infs\usa
  62. )
  63. goto skip_setupinfs
  64. )
  65. if %FileName%==tsoc.txt (
  66. if %PlocMode%==932 (
  67. set InfsPath=%SDXROOT%\termsrv\setup\inf\jpn
  68. )
  69. if %PlocMode%==1250 (
  70. set InfsPath=%SDXROOT%\termsrv\setup\inf\psu
  71. )
  72. if %PlocMode%==mirror (
  73. set InfsPath=%SDXROOT%\termsrv\setup\inf\ara
  74. )
  75. goto skip_setupinfs
  76. )
  77. if %FileName%==fxsocm.txt (
  78. if %PlocMode%==932 (
  79. set InfsPath=%SDXROOT%\printscan\faxsrv\setup\inf\jpn
  80. )
  81. if %PlocMode%==1250 (
  82. set InfsPath=%SDXROOT%\printscan\faxsrv\setup\inf\usa
  83. )
  84. if %PlocMode%==mirror (
  85. set InfsPath=%SDXROOT%\printscan\faxsrv\setup\inf\ara
  86. )
  87. goto skip_setupinfs
  88. )
  89. if %PlocMode%==932 (
  90. set InfsPath=%SDXROOT%\MergedComponents\setupinfs\jpn
  91. )
  92. if %PlocMode%==1250 (
  93. set InfsPath=%SDXROOT%\MergedComponents\setupinfs\psu
  94. )
  95. if %PlocMode%==mirror (
  96. set InfsPath=%SDXROOT%\MergedComponents\setupinfs\ara
  97. )
  98. :skip_setupinfs
  99. if %Mirror%==yes_with (
  100. set Mirror=Yes
  101. )
  102. if %Mirror%==yes_without (
  103. set Mirror=No
  104. )
  105. rem **********************************************************
  106. rem %UniLimitedTable% is limited Unicode table
  107. rem %UniLimitedMethod% is limited Unicode method
  108. rem %PartialReplacementTable% is partial replacement table
  109. rem %PartialReplacementMethod% is partial replacement method
  110. rem %LimitedReplacementTable% is limited replacement table
  111. rem %LimitedReplacementMethod% is limited replacement method
  112. rem %LogFile% is log file
  113. rem %BinPath% is binary folder
  114. rem %LcPath% is lc folder
  115. rem %PLPFile% is PLP Config file
  116. rem %PlocMode% is pseudo localization mode
  117. rem %MakePloc% is variable used by makeploc.exe
  118. rem %PrivateLC% is a variable used by makeploc.exe
  119. rem **********************************************************
  120. rem *********************************Language Neutral section*********************************
  121. echo checking if this is a language Neutral binary
  122. set LcFileName=%FileName%.lc
  123. if exist %BinPath%\%FilePath%\%FileName%.mui (
  124. set FileName=%FileName%.mui
  125. )
  126. rem *******************************************************************************************
  127. rem ******************* Determining if file needs to be mirrored or not *********************
  128. rem skip files that don't need ploc for mirror mode
  129. if not %PlocMode%==mirror goto no_mirror
  130. if %Mirror%==no goto :eof
  131. if %Mirror%==excluded goto :eof
  132. :no_mirror
  133. rem *****************************************************************************************
  134. rem ******************* files not to localize ***********************************************
  135. if %FileType%==external goto :eof
  136. if %FileType%==notloc goto :eof
  137. if %FileType%==fe-file goto :eof
  138. if %FileType%==manual goto :eof
  139. if %FileType%==perf goto :eof
  140. if %FileType%==nobin goto :eof
  141. rem *****************************************************************************************
  142. rem ******************* Excluding some JPN specific files ***********************************
  143. if %FileName%==usetup.exe goto jpnUsetup
  144. if %FileName%==autochk.exe goto jpnUsetup
  145. if %FileName%==autoconv.exe goto jpnUsetup
  146. if %FileName%==autofmt.exe goto jpnUsetup
  147. goto skip_Usetup
  148. :jpnUsetup
  149. if %plocmode%==932 (
  150. if %FileName%==usetup.exe goto :usetuploc
  151. goto :eof
  152. ) else (
  153. goto skip_Usetup
  154. )
  155. :usetuploc
  156. echo JPN Special Usetup localization case
  157. bingen -i 9 1 -o 9 1 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok
  158. FixUsetup.exe %BinPath%\%FilePath%\%FileName%.tok
  159. bingen -i 9 1 -o 9 1 -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok.tmp %BinPath%\%FilePath%\%FileName%
  160. del /q %BinPath%\%FilePath%\%FileName%.tok
  161. del /q %BinPath%\%FilePath%\%FileName%.tok.tmp
  162. goto :eof
  163. :skip_Usetup
  164. rem ******************************************************************************************
  165. rem ********************************initialization section ***********************************
  166. if %LimitedChars%==unicode (
  167. set ReplacementTable=%UniReplacementTable%
  168. set ReplacementMethod=%UniReplacementMethod%
  169. )
  170. if %LimitedChars%==oem (
  171. set ReplacementTable=%LimitedReplacementTable%
  172. set ReplacementMethod=%LimitedReplacementMethod%
  173. )
  174. if %LimitedChars%==ansi (
  175. set ReplacementTable=%partialreplacementtable%
  176. set ReplacementMethod=%partialreplacementmethod%
  177. )
  178. if %LimitedChars%==unicode_limited (
  179. set ReplacementTable=%UniLimitedTable%
  180. set ReplacementMethod=%UniLimitedMethod%
  181. )
  182. if %FileType%==macintosh (
  183. set ReplacementTable=%MacReplacementTable%
  184. set ReplacementMethod=%MacReplacementMethod%
  185. )
  186. if %FileType%==win16 (
  187. set ReplacementTable=%PartialReplacementTable%
  188. if %plocmode%==932 (
  189. set ReplacementMethod=Matching
  190. ) else (
  191. set ReplacementMethod=%PartialReplacementMethod%
  192. )
  193. )
  194. if %FileType%==html (
  195. set ReplacementTable=%PartialReplacementTable%
  196. set ReplacementMethod=%PartialReplacementMethod%
  197. )
  198. if %FileType%==ipp (
  199. set ReplacementTable=%PartialReplacementTable%
  200. set ReplacementMethod=%PartialReplacementMethod%
  201. )
  202. rem **************** Special preprocessing *************************
  203. if %OutputLanguage%==0x0418 (
  204. if %FileName%==dwil1048.dll copy %BinPath%\%FilePath%\dwil1033.dll %BinPath%\%FilePath%\dwil1048.dll
  205. )
  206. if %FileType%==setup_inf (
  207. if not exist %InfsPath%\%FileName% goto not_exist
  208. )
  209. if NOT %FileType%==setup_inf (
  210. if not exist %BinPath%\%FilePath%\%FileName% goto not_exist
  211. )
  212. rem ****************Workaround the Compdir issue ***********************
  213. if NOT %FileType%==setup_inf (
  214. copy %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tmp
  215. del /q %BinPath%\%FilePath%\%FileName%
  216. copy %BinPath%\%FilePath%\%FileName%.tmp %BinPath%\%FilePath%\%FileName%
  217. del /q %BinPath%\%FilePath%\%FileName%.tmp
  218. )
  219. rem ******************** determine lc-file *************************
  220. if %PrivateLC%==yes goto lc_end
  221. set ComponentPath=%LcBranch%\ploc\%lcfolder%\.
  222. if %LcInfo%==. goto regular_lc
  223. set LcFile=%SDXROOT%\%ComponentPath%\%LcInfo%.lc
  224. goto lc_end
  225. :regular_lc
  226. if %_BuildArch%==ia64 goto ia64lcs
  227. set LcFile=%SDXROOT%\%ComponentPath%\%FilePath%\%LcFileName%
  228. goto lc_end
  229. :ia64lcs
  230. if EXIST %SDXROOT%\%ComponentPath%\%FilePath%\ia64\%LcFileName% (
  231. set LcFile=%SDXROOT%\%ComponentPath%\%FilePath%\ia64\%LcFileName%
  232. ) else (
  233. set LcFile=%SDXROOT%\%ComponentPath%\%FilePath%\%LcFileName%
  234. )
  235. :lc_end
  236. rem ****************************************************************
  237. rem ********************* Makeploc specific section ****************
  238. if %PlocMode%==mirror (
  239. if %MakePloc%==yes (
  240. set LogFile=%FileName%.log
  241. echo Creating backup of US binary...
  242. copy /-y %FileName% %FileName%.old
  243. )
  244. goto no_tokenization1
  245. )
  246. if %MakePloc%==yes (
  247. rem set log file name
  248. set LogFile=%FileName%.log
  249. rem tokenize us file
  250. echo Tokenizing US version of %BinPath%\%FilePath%\%FileName%...
  251. lccmd -i %InputLanguage% -t1 %BinPath%\%FilePath%\%FileName% %FileName%.tok.us > Nul
  252. echo Creating backup of US binary...
  253. copy /-y %FileName% %FileName%.old
  254. if NOT %PrivateLC%==yes (
  255. rem copy lc-file
  256. echo Copying lc-file %LcFile%...
  257. if exist %LcFile% copy /-y %LcFile% %LcFileName% 2>Nul
  258. )
  259. goto no_tokenization1
  260. )
  261. rem **************************************************************************************************
  262. :no_tokenization1
  263. rem *********************************** determining file type *****************************************
  264. :types
  265. if %FileType%==managed goto managed
  266. if %FileType%==msi goto Msi_case
  267. if %FileName%==comdlg32.dll (
  268. if %PlocMode%==mirror goto MirrComdlg
  269. if %PlocMode%==932 goto 932Comdlg
  270. )
  271. rem if %FileName%==conf.adm goto wmi
  272. rem if %FileName%==inetres.adm goto wmi
  273. rem if %FileName%==system.adm goto wmi
  274. if %FileName%==msobshel.htm goto msobshel
  275. if %FileName%==msprivs.dll goto msprivs
  276. if %FileName%==acmboot.exe goto PlpFiles
  277. if %FileType%==ini goto ini_file
  278. rem if %FileType%==macintosh goto Macintosh
  279. if %FileType%==win16 goto 16-bit
  280. if %FileType%==setup_inf goto setup_inf_file
  281. if %FileType%==inf goto inf_file
  282. rem if %FileType%==ipp goto ipp_file
  283. if %FileType%==win32_setup goto setup_file
  284. if %FileType%==win32_comctl goto eof
  285. if %FileType%==win32_multi goto multilang
  286. if %FileType%==win32_multi_009 goto multilang_009
  287. if %FileType%==win32_bi goto win32_bi
  288. rem if %FileType%==wmi goto wmi
  289. if %FileType%==xml goto xml
  290. if %FileType%==mnc_snapin goto mnc_Snapin
  291. if %PlocMode%==932 (
  292. if %FileType%==FE-Multi goto FE_Multi
  293. )
  294. rem ************************* pseudo localize different file formats ***********************
  295. :regular
  296. rem Default case...
  297. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  298. if %PlocMode%==mirror (
  299. echo lccmd -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName%
  300. lccmd -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  301. ) else (
  302. lccmd -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  303. )
  304. goto end
  305. rem **************************************** Special cases ******************************************
  306. :FE_Multi
  307. echo Tokenizing %BinPath%\%FilePath%\%FileName%...
  308. bingen -i 9 1 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile%
  309. echo Replacing lang section with US resources...
  310. bingen -i 9 1 -o %BingenLang1% %BingenLang2% -a %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  311. rem bingen -i %BingenLang1% %BingenLang2% -o %BingenLang1% %BingenLang2% -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  312. echo Pseudo localizing language section of %BinPath%\%FilePath%\%FileName%...
  313. lccmd -i %OutputLanguage% -o %OutputLanguage% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  314. lccmd -i 9 1 -o 9 1 -a %LcFile% -l 437 -k Matching -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  315. echo Deleting temporary token file...
  316. del /q %BinPath%\%FilePath%\%FileName%.tok
  317. goto end
  318. :managed
  319. goto end
  320. echo call Regasm.exe ManagedParser.dll
  321. call Regasm.exe ManagedParser.dll
  322. echo Pseudo localizing managed %BinPath%\%FilePath%\%FileName%...
  323. if %PlocMode%==mirror (
  324. echo lccmd -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%
  325. lccmd -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tmp 2>> %LogFile% > Nul
  326. ) else (
  327. echo lccmd -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName%
  328. lccmd -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tmp 2>> %LogFile% > Nul
  329. )
  330. copy /y /v %BinPath%\%FilePath%\%FileName%.tmp %BinPath%\%FilePath%\%FileName%
  331. del /q %BinPath%\%FilePath%\%FileName%.tmp
  332. call Regasm.exe ManagedParser.dll /unregister
  333. goto end
  334. :mnc_Snapin
  335. rem msc_Snapin special case...
  336. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  337. if %PlocMode%==mirror (
  338. echo lccmd -e 94 -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName%
  339. lccmd -e 94 -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  340. ) else (
  341. lccmd -e 94 -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  342. )
  343. goto end
  344. :932Comdlg
  345. lccmd -x %PlocPath%\jpncmdlgcfg.xml -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  346. goto end
  347. :PlpFiles
  348. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  349. if %PlocMode%==mirror (
  350. lccmd -x %PLPFile% -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  351. ) else (
  352. lccmd -x %PLPFile% -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  353. )
  354. goto end
  355. :inf_file
  356. rem inf files
  357. if %LimitedChars%==ansi goto skip_conversion
  358. echo Converting %BinPath%\%FilePath%\%FileName% to Unicode...
  359. unitext -z -m -437 %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tmp >> %LogFile%
  360. copy %BinPath%\%FilePath%\%FileName%.tmp %BinPath%\%FilePath%\%FileName% >> %LogFile%
  361. del /q %BinPath%\%FilePath%\%FileName%.tmp
  362. :unicode_inf_file
  363. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  364. lccmd -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  365. goto end
  366. :skip_conversion
  367. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  368. lccmd -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  369. goto end
  370. :setup_inf_file
  371. rem @echo on
  372. rem setup_inf files
  373. if %LimitedChars%==ansi goto skip_conversion
  374. if %FileName%==intl.txt goto Intl_inf
  375. echo Converting %InfsPath%\%FileName% to Unicode...
  376. unitext -z -m -437 %InfsPath%\%FileName% %InfsPath%\%FileName%.tmp >> %LogFile%
  377. copy %InfsPath%\%FileName%.tmp %InfsPath%\%FileName% >> %LogFile%
  378. del /q %InfsPath%\%FileName%.tmp
  379. rem :unicode_inf_file
  380. echo Pseudo localizing %InfsPath%\%FileName%...
  381. lccmd -a %LcFile% -g %InfsPath%\%FileName% 2>> %LogFile%
  382. unitohex -u %InfsPath%\%FileName% %InfsPath%\%FileName%.tmp %LogFile%
  383. copy %InfsPath%\%FileName%.tmp %InfsPath%\%FileName% >> %LogFile%
  384. del /q %InfsPath%\%FileName%.tmp
  385. goto end
  386. :skip_conversion
  387. echo Pseudo localizing %InfsPath%\%FileName%...
  388. lccmd -a %LcFile% -g %InfsPath%\%FileName% 2>> %LogFile%
  389. goto end
  390. :Intl_inf
  391. echo Pseudo localizing %InfsPath%\%FileName%...
  392. lccmd -a %LcFile% -x %PLPFile% -g %InfsPath%\%FileName% 2>> %LogFile%
  393. goto end
  394. rem ************ Not Exist error *********************
  395. :not_exist
  396. echo Error, %BinPath%\%FilePath%\%FileName% can not be found...
  397. echo Error, %BinPath%\%FilePath%\%FileName% can not be found >> %LogFile%
  398. goto :eof
  399. rem ******************************************
  400. rem ************ Mirrored Comdlg special case ********************
  401. :MirrComdlg
  402. rem Special case comdlg32.dll (special mirror settings)
  403. echo Pseudo localizing %FileName% (arabic section)...
  404. lccmd -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.401 2>> %LogFile% > Nul
  405. echo Pseudo localizing %FileName% (arabic section 2)...
  406. lccmd -i 9 1 -o 1 2 -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.801 2>> %LogFile% > Nul
  407. rsrc %BinPath%\%FilePath%\%FileName%.401 -t
  408. rem mirror.exe %BinPath%\%FilePath%\%FileName%.401.rsrc No %LogFile%
  409. rsrc %BinPath%\%FilePath%\%FileName% -l 401 -a %BinPath%\%FilePath%\%FileName%.401.rsrc
  410. del /q %BinPath%\%FilePath%\%FileName%.401
  411. del /q %BinPath%\%FilePath%\%FileName%.401.rsrc
  412. rem del /q %BinPath%\%FilePath%\%FileName%.401.rsrc.mir
  413. rsrc %BinPath%\%FilePath%\%FileName%.801 -t
  414. rem mirror.exe %BinPath%\%FilePath%\%FileName%.801.rsrc No %LogFile%
  415. rsrc %BinPath%\%FilePath%\%FileName% -l 801 -a %BinPath%\%FilePath%\%FileName%.801.rsrc
  416. del /q %BinPath%\%FilePath%\%FileName%.801
  417. del /q %BinPath%\%FilePath%\%FileName%.801.rsrc
  418. rem del /q %BinPath%\%FilePath%\%FileName%.801.rsrc.mir
  419. goto :eof
  420. rem ******************************************
  421. rem ************ msobshel special case ********************
  422. :msobshel
  423. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  424. if %PlocMode%==mirror (
  425. lccmd -l %partialreplacementtable% -k %partialreplacementmethod% -a %LcFile% -x %PLPFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  426. ) else (
  427. lccmd -l %partialreplacementtable% -k %partialreplacementmethod% -a %LcFile% -x %PLPFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  428. )
  429. goto end
  430. rem ******************************************
  431. rem ************ multilang special case ********************
  432. :multilang
  433. rem Multilingual file
  434. echo Tokenizing %BinPath%\%FilePath%\%FileName%...
  435. bingen -i 9 1 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile%
  436. echo Replacing lang section with US resources...
  437. bingen -i 9 1 -o %BingenLang1% %BingenLang2% -a %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  438. bingen -i %BingenLang1% %BingenLang2% -o %BingenLang1% %BingenLang2% -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  439. echo Pseudo localizing language section of %BinPath%\%FilePath%\%FileName%...
  440. if %PlocMode%==mirror (
  441. lccmd -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  442. ) else (
  443. lccmd -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  444. )
  445. echo Deleting temporary token file...
  446. del /q %BinPath%\%FilePath%\%FileName%.tok
  447. goto end
  448. :multilang_009
  449. rem Multilingual file
  450. echo Tokenizing %BinPath%\%FilePath%\%FileName%...
  451. bingen -i 9 0 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile%
  452. echo Replacing lang section with US resources...
  453. bingen -i 18 1 -o %BingenLang1% %BingenLang2% -a %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  454. bingen -i %BingenLang1% %BingenLang2% -o %BingenLang1% %BingenLang2% -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  455. echo Pseudo localizing language section of %BinPath%\%FilePath%\%FileName%...
  456. if %PlocMode%==mirror (
  457. lccmd -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  458. ) else (
  459. lccmd -x %PLPFile% -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  460. )
  461. echo Deleting temporary token file...
  462. del /q %BinPath%\%FilePath%\%FileName%.tok
  463. goto end
  464. rem ******************************************
  465. :win32_bi
  466. rem Bi-lingual file
  467. echo Tokenizing %BinPath%\%FilePath%\%FileName%...
  468. bingen -i 9 1 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile%
  469. echo Replacing lang section with US resources...
  470. bingen -i 9 1 -o %BingenLang1% %BingenLang2% -a %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  471. bingen -i %BingenLang1% %BingenLang2% -o %BingenLang1% %BingenLang2% -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  472. echo Pseudo localizing language section of %BinPath%\%FilePath%\%FileName%...
  473. if %PlocMode%==mirror (
  474. lccmd -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  475. ) else (
  476. lccmd -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  477. )
  478. echo Deleting temporary token file...
  479. del /q %BinPath%\%FilePath%\%FileName%.tok
  480. if %PlocMode%==mirror goto end
  481. echo Pseudo localizing US resource section of %BinPath%\%FilePath%\%FileName%...
  482. lccmd -i 0x0409 -o 0x0409 -l 1252 -k matching -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  483. goto end
  484. :msprivs
  485. rem Special case for msprivs.dll ( add 418 resources)
  486. if %PlocMode%==mirror goto end
  487. echo Tokenizing US section of %BinPath%\%FilePath%\%FileName%..
  488. bingen -i 9 1 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile% > Nul
  489. echo Replacing lang section with US resources...
  490. bingen -i 9 1 -o %BingenLang1% %BingenLang2% -a %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  491. echo Pseudo localizing language section of %BinPath%\%FilePath%\%FileName%...
  492. if %PlocMode%==mirror (
  493. lccmd -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  494. ) else (
  495. lccmd -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  496. )
  497. echo Deleting temporary token file...
  498. del /q %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile% > Nul
  499. goto end
  500. :comctl
  501. rem Special case for comctl (special parser settings)
  502. if %PlocMode%==mirror goto comctl_mirror
  503. echo Tokenizing US section of %BinPath%\%FilePath%\%FileName%...
  504. bingen -i 9 1 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile% > Nul
  505. echo Replacing lang section with US resources...
  506. bingen -i 9 1 -o %BingenLang1% %BingenLang2% -a %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  507. bingen -i 9 1 -o %BingenLang1% 0 -a %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  508. echo Pseudo localizing language section of %BinPath%\%FilePath%\%FileName%...
  509. if %PlocMode%==mirror (
  510. lccmd -s comctl -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  511. lccmd -s comctl -i %OutputLanguageNeutral% -o %OutputLanguageNeutral% -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  512. ) else (
  513. lccmd -s comctl -i %OutputLanguage% -o %OutputLanguage% -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  514. lccmd -s comctl -i %OutputLanguageNeutral% -o %OutputLanguageNeutral% -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  515. )
  516. echo Deleting temporary token file...
  517. del /q %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile% > Nul
  518. goto end
  519. :comctl_mirror
  520. rem Special case for comctl (special parser settings)
  521. echo Restamping lang section of %BinPath%\%FilePath%\%FileName%...
  522. bingen -i 9 1 -o 9 1 -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile% > Nul
  523. lccmd -s comctl -i 1 0 -o 1 1 -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName%
  524. echo Replacing Arabic resources with US resources...
  525. bingen -i 1 1 -o 1 0 -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok %BinPath%\%FilePath%\%FileName%
  526. echo Deleting temporary token file...
  527. del /q %BinPath%\%FilePath%\%FileName%.tok 2>> %LogFile% > Nul
  528. goto end
  529. :setup_file
  530. rem Special cases for setup files
  531. if %FileName%==winnt32a.dll goto winnt32
  532. if %FileName%==winnt32u.dll goto winnt32
  533. goto no_winnt32
  534. :winnt32
  535. if %MakePloc%==no echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  536. if %_BuildType%==chk (
  537. lccmd -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  538. ) else (
  539. lccmd -l %PartialReplacementTable% -k %PartialReplacementMethod% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  540. )
  541. goto end:
  542. :no_winnt32
  543. if %FileName%==usetup.exe goto usetup
  544. if %FileName%==spcmdcon.sys goto usetup
  545. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  546. if %PlocMode%==mirror (
  547. lccmd -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  548. ) else (
  549. lccmd -l %PartialReplacementTable% -k %PartialReplacementMethod% -x %PLPFile% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  550. )
  551. goto end:
  552. :usetup
  553. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  554. lccmd -l %LimitedReplacementTable% -k %LimitedReplacementMethod% -x %PLPFile% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  555. goto end
  556. :ini_file
  557. rem ini-files
  558. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  559. lccmd -e 4 -l %partialreplacementtable% -k %partialreplacementmethod% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile%
  560. goto end
  561. :Msi_case
  562. rem Special case for msi-files with RTF resources
  563. for %%i in (%BinPath%\%FilePath%\%FileName%) do set SmallName=%%~ni
  564. if not exist %BinPath%\%FileName%.tmp\%SmallName%rtf md %BinPath%\%FileName%.tmp\%SmallName%rtf
  565. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  566. lccmd -l %partialreplacementtable% -k %partialreplacementmethod% -x %PLPFile% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FileName%.tmp\%FileName% 2> Nul > Nul
  567. copy %BinPath%\%FilePath%\%SmallName%rtf\*.rtf %BinPath%\%FileName%.tmp\%SmallName%rtf\*.* /y >> %LogFile%
  568. lccmd -l %partialreplacementtable% -k %partialreplacementmethod% -x %PLPFile% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FileName%.tmp\%FileName% 2>> %LogFile% > Nul
  569. copy %BinPath%\%FileName%.tmp\%FileName% %BinPath%\%FilePath% /y >> %LogFile%
  570. if exist %BinPath%\%FileName%.tmp rd /s /q %BinPath%\%FileName%.tmp
  571. if exist %BinPath%\%FilePath%\%SmallName%rtf rd /s /q %BinPath%\%FilePath%\%SmallName%rtf
  572. goto end
  573. :xml
  574. rem xml files, often have different names. We will loc under the name xml
  575. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  576. if %PlocMode%==932 (
  577. lccmd -x %PlocPath%\jpnxml.xml -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%tmp.xml 2>> %LogFile% > Nul
  578. ) else (
  579. lccmd -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%tmp.xml 2>> %LogFile% > Nul
  580. )
  581. copy %BinPath%\%FilePath%\%FileName%tmp.xml %BinPath%\%FilePath%\%FileName% > Nul
  582. del /q %BinPath%\%FilePath%\%FileName%tmp.xml
  583. goto end
  584. :16-bit
  585. if %PlocMode%==932 (
  586. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  587. lccmd -t %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok
  588. FixFE16.exe %BinPath%\%FilePath%\%FileName%.tok
  589. echo lcbuild -i 0x409 -o 0x409 -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok.tmp %BinPath%\%FilePath%\%FileName%
  590. lcbuild -i 0x409 -o 0x409 -r %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.tok.tmp %BinPath%\%FilePath%\%FileName%.new
  591. copy %BinPath%\%FilePath%\%FileName%.new %BinPath%\%FilePath%\%FileName%
  592. del /q %BinPath%\%FilePath%\%FileName%.new
  593. del /q %BinPath%\%FilePath%\%FileName%.tok
  594. del /q %BinPath%\%FilePath%\%FileName%.tok.tmp
  595. echo lccmd -x %FEConfig16% -k prepend -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  596. lccmd -x %FEConfig16% -k prepend -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  597. )
  598. if %PlocMode%==932 goto end
  599. rem Default case...
  600. echo Pseudo localizing %BinPath%\%FilePath%\%FileName%...
  601. if %PlocMode%==mirror (
  602. echo lccmd -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName%
  603. lccmd -s %ParserSettings% -a %LcFile% -b %Mirror% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  604. ) else (
  605. lccmd -s %ParserSettings% -a %LcFile% -g %BinPath%\%FilePath%\%FileName% 2>> %LogFile% > Nul
  606. )
  607. goto end
  608. :end
  609. goto skipForLopp
  610. FOR /F %%f in ('dir /s/b/a-d/l "%BinPath%\%FilePath%\%FileName%"') DO (
  611. IF "%%~zf"=="0" (
  612. copy %_NTTREE%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%
  613. echo %FilePath%\%FileName% got corrupted during the ploc process. File was reverted to English >> %lccmderrfile%
  614. )
  615. )
  616. :skipForLopp
  617. rem ********************* create resources (part 2) ****************
  618. rem if not "%PlocBuildBranch%"=="main" goto no_tokenization2
  619. rem ////////skipping tokenization////////////
  620. rem goto no_tokenization2
  621. rem /////////////////////////////////////////
  622. if %PlocMode%==mirror goto no_tokenization2
  623. if %MakePloc%==yes (
  624. rem tokenize loc file
  625. echo Tokenizing pseudo version of %BinPath%\%FilePath%\%FileName%...
  626. if %FileType%==xml goto xmltok3
  627. lccmd -i %OutputLanguage% -t1 %BinPath%\%FilePath%\%FileName% %FileName%.tok.psu > Nul
  628. goto end_xmltok3
  629. :xmltok3
  630. copy %BinPath%\%FilePath%\%FileName% %BinPath%\%FilePath%\%FileName%.xml
  631. lccmd -i %OutputLanguage% -t1 %BinPath%\%FilePath%\%FileName%.xml %FileName%.tok.psu > Nul
  632. del /q %BinPath%\%FilePath%\%FileName%.xml
  633. :end_xmltok3
  634. rem create merged file
  635. echo Merging token files...
  636. mergetok %FileName%.tok.us %FileName%.tok.psu %FileName%.tok 2> Nul
  637. echo Removing temporary files...
  638. if exist %FileName%.tok.us del /q %FileName%.tok.us
  639. if exist %FileName%.tok.psu del /q %FileName%.tok.psu
  640. if exist %LogFile% del /q %LogFile%
  641. )
  642. :no_tokenization2
  643. rem ********************** postprocessing files ***************
  644. if %FileName%==luna.mst goto luna.mst
  645. goto :eof
  646. :luna.mst
  647. echo packthem -s %BinPath%\%FilePath%\luna.mst
  648. packthem -s %BinPath%\%FilePath%\luna.mst
  649. echo checkfix -v %BinPath%\%FilePath%\luna.mst
  650. checkfix -v %BinPath%\%FilePath%\luna.mst
  651. goto :eof
  652. :eof