Source code of Windows XP (NT5)
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.

318 lines
18 KiB

  1. <head><style><!--
  2. h2 {font-style: italic; font-size: 115%; font-weight: bold; margin-top: 0.4in}
  3. p {margin-left: 1 em; margin-top: 0.1in; margin-bottom: 0; border-bottom:0; padding-bottom:0}
  4. pre {margin-left: 2 em}
  5. td {padding-left: 1ex; padding-right: 1ex}
  6. th {padding-left: 1ex; padding-right: 1ex}
  7. table.code {font-size: 88%; line-height:115%; margin-left: 2em}
  8. table.code td {padding-right: 1ex; padding-left: 0}
  9. --></style></head><body>
  10. See <a href="#rsrcIndex">Index</a>
  11. <h2> <a name="RSRC_Command_line">RSRC Command line</a>
  12. </h2>
  13. </p>
  14. <pre>RSRC Executable [-l LocLang] [-u UnlocLang] [-i Types] [-q]
  15. [ [-t|-d] TextOutput [-c UnlocExecutable]
  16. | [-a|-r] text-input [-s symbols] [-v] ]
  17. </pre>
  18. <p><b><a name="Executable">Executable</a></b><p style="margin-left: 5ex; margin-top: 0">Win32 binary to analyse (default), to generate tokens (-t)
  19. or dump (-d) from, or containing resources to be replaced (-r)
  20. or appended to (-a).
  21. <p><b><a name="-l_LocLang">-l LocLang</a></b><p style="margin-left: 5ex; margin-top: 0">Restrict processing to the specified localized language. LangId
  22. should be specified as a full hex NLS Language id, for example use
  23. '-l 409' for US English. Required for replace (-r) operation.
  24. <p><b><a name="-u_UnlocLang">-u UnlocLang</a></b><p style="margin-left: 5ex; margin-top: 0">Specifies unlocalized language, defaults to 409 (US English).
  25. <p><b><a name="-i_Types">-i Types</a></b><p style="margin-left: 5ex; margin-top: 0">Restrict processing to listed types. Each type is indicated by a letter
  26. as below:
  27. </p>
  28. <table border align=centre border=2 cellpadding=1 cellspacing=0 style="margin-left:0.6in; margin-top: 0.1in">
  29. <tr align=left><th> Letter <th> Type <th> Letter <th> Type <th> Letter <th> Type
  30. <tr><td> c <td> Cursors <td> g <td> Message tables <td> n <td> INFs
  31. <tr><td> b <td> Bitmaps <td> v <td> Version info <td> h <td> HTML
  32. <tr><td> i <td> Icons <td> a <td> Accelerators <td> x <td> Binary data
  33. <tr><td> m <td> Menus <td> f <td> Font directories <td> <td>
  34. <tr><td> d <td> Dialogs <td> t <td> Fonts <td> o <td> All others
  35. <tr><td> s <td> Strings <td> r <td> RCDATA <td> a <td> All (default)
  36. </table>
  37. <p><b><a name="-q">-q</a></b><p style="margin-left: 5ex; margin-top: 0">Quiet. By default Rsrc displays summary statistics of types and languages
  38. of resources processed. -q suppresses all output except warning and error messages.
  39. <p><b><a name="-t_TextOutput">-t TextOutput</a></b><p style="margin-left: 5ex; margin-top: 0">Generate tokens in checkin format.
  40. <p><b><a name="-d_TextOutput">-d TextOutput</a></b><p style="margin-left: 5ex; margin-top: 0">Dump resources in Hex & ASCII format.
  41. <p><b><a name="-c_UnlocExecutable">-c UnlocExecutable</a></b><p style="margin-left: 5ex; margin-top: 0">Compare with unlocalized (English) resources - localised
  42. resources in executable are compared with English resources in
  43. UnlocExecutable. When the localised resource is bit for bit identical
  44. with the English resource RSRC writes a one line unloc
  45. token instead of the full resource. Valid only with tokenise (-t)
  46. option.
  47. <p><b><a name="-a_TextInput">-a TextInput</a></b><p style="margin-left: 5ex; margin-top: 0">Append resources from text input file. Every resource in the
  48. text file is added to the executable. Resources already in the executable
  49. are not removed. When a resource from the token file has the same type, id
  50. and language as one in the executable, the executable resource is replaced
  51. by the token resource.
  52. <p><b><a name="-r_TextInput">-r TextInput</a></b><p style="margin-left: 5ex; margin-top: 0">Replace English resources in executable by localised resources
  53. from text file. Requires -l parameter to specify localisation language.
  54. When a resource from the token file has the same type and id as one in the
  55. executable, and the executable resource is US English (409) and the localised
  56. resource is in the language specified on the -l parameter, the US English
  57. resource is removed.
  58. <p><b><a name="-s_Symbols">-s Symbols</a></b><p style="margin-left: 5ex; margin-top: 0">Symbol file (.dbg format). When RSRC updates the header checksum
  59. in executable, it will also do so in the named symbol file. Valid only
  60. with the replace (-r) and append (-a) options.
  61. <p>Miscellaneous options
  62. <p><b><a name="-v">-v</a></b><p style="margin-left: 5ex; margin-top: 0">Update file and product version. By default any file and product version
  63. in the token file is ignored during update/append, the file and product
  64. versions from the original unlocalised resources are retained.
  65. </p>
  66. <table cellpadding=0 cellspacing=0 class=code>
  67. </table>
  68. <h2> <a name="Definitions">Definitions</a>
  69. </h2>
  70. <p><b><a name="Resource_key">Resource key</a></b><p style="margin-left: 5ex; margin-top: 0">The combination of resource type, resource id and
  71. resource language. The resource key uniquely identifies the
  72. resource. A Win32 executable can contain any combination of
  73. languages, ids and types so long as no two resources have the
  74. same type, key and language.
  75. <p><b><a name="Resource_type">Resource type</a></b><p style="margin-left: 5ex; margin-top: 0">A numeric or string value. Some numeric values are
  76. predefined, for example menus and dialogs, but apps can and
  77. do use any value they choose.
  78. <p><b><a name="Resource_id">Resource id</a></b><p style="margin-left: 5ex; margin-top: 0">A numeric or string value. Used by an application to
  79. identify the resource when calling FindResource, LoadString etc.
  80. <p><b><a name="Resource_language">Resource language</a></b><p style="margin-left: 5ex; margin-top: 0">An NLS LANGID, i.e. a combination of primary and
  81. sub-language, such as 0409 (US English).
  82. <p><b><a name="Unloc_token">Unloc token</a></b><p style="margin-left: 5ex; margin-top: 0">A line in the token file specifying a localised resource
  83. key followed by '=lang,cksum' where lang is the unlocalised
  84. language (usually 0409) and cksum is the checksum of the unlocalised
  85. resource. Used when the only difference between the localised and
  86. unlocalised resource is the language in the resource key.
  87. </p>
  88. <table cellpadding=0 cellspacing=0 class=code>
  89. </table>
  90. <h2> <a name="Use_during_localisation_checkin_process">Use during localisation checkin process</a>
  91. </h2>
  92. </p>
  93. <pre>RSRC LocalisedExecutable -c UnlocExecutable -t Tokens -l LocLang [-u UnlocLang]
  94. </pre>
  95. <p>Extracts localized tokens for the specified langauge.
  96. <p>Where a resource in the localised executable is bit for bit identical
  97. to a resource in the unlocalized executable, the resource content is not
  98. written to the token file. In its place RSRC writes an unloc token
  99. giving the checksum of the resource and specifying the target language.
  100. <p>Warnings are generated if the localised executable contains resources
  101. in languages other than that specified by the -l parameter.
  102. <p>Unlocalised resources for comparison are looked up in the unlocalised
  103. executable in the language specified on the -u parameter, default 409
  104. (US ENglish).
  105. </p>
  106. <table cellpadding=0 cellspacing=0 class=code>
  107. </table>
  108. <h2> <a name="Use_during_the_build_to_update_a_single_language_executable">Use during the build to update a single language executable</a>
  109. </h2>
  110. </p>
  111. <pre>RSRC Executable [-u UnlocLang] -r Tokens -l LocLang -s SymbolFile
  112. </pre>
  113. <p>Each localised resource in the token file is added to the executable.
  114. <p>Each corresponding unlocalized resource is removed from the executable.
  115. <p>For each unloc token the unlocalized resource is found in the executable
  116. and its language is updated to the target localized language recorded
  117. in the unloc token.
  118. <p>Tokens of other than the specified localised language are not
  119. processed, but generate warnings.
  120. <p>Warnings are generated for any resources not appearing in both the
  121. executable and token files.
  122. <p>Warnings are also generated for resources of other than the unlocalised
  123. language found in the original executable, and resources of other than
  124. the localised language in the token file.
  125. <p>The unlocalised language defaults to 409 (US English).
  126. </p>
  127. <table cellpadding=0 cellspacing=0 class=code>
  128. </table>
  129. <h2> <a name="Use_during_the_build_to_add_resources_to_a_multi-language_executable">Use during the build to add resources to a multi-language executable</a>
  130. </h2>
  131. </p>
  132. <pre>RSRC Executable [-u UnlocLang] -a Tokens [-l Language] -s SymbolFile
  133. </pre>
  134. <p>Localised resources from the token file are added to the executable.
  135. <p>For each unloc token the unlocalised resource is found in the executable
  136. and copied for the localised language recorded in the unloc token.
  137. <p>If '-l Languge' is specified, only tokens of that language are added.
  138. When used with the append (-a) option, '-l Language' applies only to
  139. the token file: pre-existing resources in the executable are not affected.
  140. <p>If a resource from the token file matches a resource already in the
  141. executable in type, name and language, the executable resource
  142. is replaced.
  143. <p>Warnings are generated if any token in the executable is replaced, or
  144. if the unlocalised resource corresponding to an unloc token is missing
  145. or has a checksum which differs from the unlocalised resource that was
  146. passed on the '-u' parameter when the toke file was created.
  147. <p>If the '-l Language' option is used, warnings are generated for any
  148. resources of other languages found in the token file.
  149. </p>
  150. <table cellpadding=0 cellspacing=0 class=code>
  151. </table>
  152. <h2> <a name="Token_format_-_resource_key_and_header">Token format - resource key and header</a>
  153. </h2>
  154. <p>A resource may be represented by one or more lines. When
  155. a resource is spread over more than one line, all lines except the
  156. first are indented by three spaces.
  157. <p>The first line of every resource starts with the resource key as follows:
  158. <p>type,id,language;
  159. <p>This is followed by the codepage recorded in the resource directory.
  160. Note that the codepage is not part of the resource key, and is not
  161. maintained consistently by all software. In particular:
  162. </p>
  163. <ul> <li> RC writes the codepage as zero
  164. <li> The NT UpdateResource API writes the codepage as 1252
  165. <li> Locstudio writes a codepage that corresponds to the resource language
  166. </ul>
  167. <p>Winnt.h documents the codepage as follows:
  168. <p>"Each resource data entry ... contains ... a CodePage that should be
  169. used when decoding code point values within the resource data.
  170. Typically for new applications the code page would be the unicode
  171. code page.'
  172. <p>In practise I have never seen the codepage value set to Unicode (1200).
  173. <p>If the '-c' (unlocalised comparison) parameter was provided on the
  174. rsrc command, and there was an unlocalised resource with the same type
  175. and id, the language and checksum of that unlocalised resource are
  176. appended.
  177. <p>Finally, the resource data is represented in one of the forms below,
  178. or as 'unloc' if the resource data exactly matches the unlocalised resource
  179. found in the file passed by 'c'.
  180. <p>There are thus three possible token key/header formats as follows:
  181. </p>
  182. <pre>type,id,language;codepage;resource-data
  183. </pre>
  184. <p>Resource recorded in full, either no '-c' parameter specified, or
  185. resource does not exist in unlocalised file.
  186. </p>
  187. <pre>type,id,language;codepage,unlocalised-checksum,language;resource-data
  188. </pre>
  189. <p>Resource recorded in full, '-c' parameter was specified, and localised
  190. resource image differed from unlocalised resource image.
  191. </p>
  192. <pre>type,id,language;codepage,unlocalised-checksum,language;'Unloc'
  193. </pre>
  194. <p>Resource recorded in full, '-c' parameter was specified, and localised
  195. resource image was identical to unlocalised resource image.
  196. </p>
  197. <table cellpadding=0 cellspacing=0 class=code>
  198. </table>
  199. <h2> <a name="Token_samples_-_default_hex_format">Token samples - default hex format</a>
  200. </h2>
  201. <p>For most resource types, RSRC generates resources
  202. as a string of hex digits.
  203. <p>For example, the following represents an accelerator resource.
  204. </p>
  205. <pre>0009,0002,0409;00000000;Hex;00000020:030074008e00000003002e00840000000b0044008400000087002e0084000000
  206. </pre>
  207. </p>
  208. <ul> <li> Type 0x0009 (Accelerator)
  209. <li> Id 0x0002
  210. <li> Language 0x0409 (LANG_ENGLISH, SUBLANG_US)
  211. <li> Codepage 0 (implies resource was probably generated by RC)
  212. <li> Length in bytes 0x0020
  213. </ul>
  214. <p>The resource is short, so its hex representation follows the length.
  215. <p>A larger binary resource is represented on multiple lines as follows:
  216. </p>
  217. <pre>000a,4000,0409;00000000;Hex;0000016a
  218. 00000000:0000640100004c0000000114020000000000c000000000000046830000003508000050130852c8e0bd0170493f38ace1bd016044d085c9e0bd01003000000000000001000000000000000000000000000000590014001f0fe04fd020ea3a6910a2d808002b30309d190023563a5c000000000000000000000000000000000065
  219. 00000080:7c15003100000000003025a49e308857696e6e74000015003100000000002f25d3863508466f6e747300000000490000001c000000010000001c0000003900000000000000480000001d0000000300000063de7d98100000005f535445504853544550485f00563a5c57494e4e545c466f6e7473000010000000050000a02400
  220. 00000100:00004200000060000000030000a05800000000000000737465706800000000000000000000004255867d3048d211b5d8d085029b1cfa4119c94a9f4dd211871f0000000000004255867d3048d211b5d8d085029b1cfa4119c94a9f4dd211871f00000000000000000000
  221. </pre>
  222. </p>
  223. <ul> <li> Type 0x000a (RCDATA)
  224. <li> Id 0x4000
  225. <li> Language 0x0409 (LANG_ENGLISH, SUBLANG_US)
  226. <li> Codepage 0
  227. <li> Length in bytes 0x016a
  228. </ul>
  229. <p>The hex representation is split onto multiple lines each of 128 bytes.
  230. </p>
  231. <table cellpadding=0 cellspacing=0 class=code>
  232. </table>
  233. <h2> <a name="Warnings_and_errors">Warnings and errors</a>
  234. </h2>
  235. </p>
  236. <ul> <li> warning RSRC100: Localised resource has no corresponding unlocalised resource in %s
  237. <li> warning RSRC110: Unlocalised resource from token file appended to executable
  238. <li> warning RSRC111: Unlocalised resource from token file replaced unlocalised resource in executable
  239. <li> warning RSRC112: Localised resource from token file replaced localised resource already present in executable
  240. <li> warning RSRC113: Localised resource from token file appended to executable - there was no matching unlocalised resource
  241. <li> warning RSRC120: Token file resource does not match specified language - ignored
  242. <li> warning RSRC121: Token file resource is not a requested resource type - ignored
  243. <li> warning RSRC122: executable unlocalised resource checksum does not match checksum recorded in token file for resource %s
  244. <li> warning RSRC124: missing executable unlocalised resource for %s
  245. <li> warning RSRC125: executable contains no unlocalised resource corresponding to resource %s
  246. <li> warning RSRC160: Symbol file does not match exectable
  247. <li> warning RSRC161: Symbol file not processed
  248. <li> warning RSRC162: Could not reopen executable %s to update checksum
  249. <li> warning RSRC163: Failed to write updated symbol checksum
  250. <li> warning RSRC170: No localizable resources in %s
  251. <li> warning RSRC171: could not close executable
  252. </ul>
  253. </p>
  254. <ul> <li> error RSRC230: 'Unloc' token is missing unlocalised resource information for %s
  255. <li> error RSRC231: Failed to apply unloc token
  256. <li> error RSRC232: Failed to apply token
  257. <li> error RSRC300: Hex digit expected
  258. <li> error RSRC301: Hex value too large
  259. <li> error RSRC302: Unexpected end of file
  260. <li> error RSRC303: \'%s\' expected
  261. <li> error RSRC304: newline expected
  262. <li> error RSRC310: Unrecognised resource type for resource %s
  263. <li> error RSRC400: -t (tokenise) option excludes -d, -a, -r, and -s
  264. <li> error RSRC401: -d (dump) option excludes -t, -u, -a, -r, and -s
  265. <li> error RSRC402: -a (append) option excludes -t, -d, -u, and -r
  266. <li> error RSRC403: -r (replace) option excludes -t, -d, -u, and -a
  267. <li> error RSRC404: -r (replace) option requires -l (LangId)
  268. <li> error RSRC405: Analysis excludes -s
  269. <li> error RSRC420: Update failed.
  270. <li> error RSRC421: Token extraction failed.
  271. <li> error RSRC422: Analysis failed.
  272. <li> error RSRC500: Corrupt executable - resource appears more than once
  273. <li> error RSRC501: %s is not an executable file
  274. <li> error RSRC502: %s is not a Win32 executable file
  275. <li> error RSRC503: No resources in %s
  276. <li> error RSRC510: Cannot open executable file %s
  277. <li> error RSRC511: cannot find resource directory in %s
  278. <li> error RSRC512: Cannot create resource token file %s
  279. <li> error RSRC513: Cannot open unlocalised executable file %s
  280. <li> error RSRC514: cannot find resource directory in unlocalised executable %s
  281. <li> error RSRC515: cannot write delta token file %s
  282. <li> error RSRC516: cannot write stand alone token file %s
  283. <li> error RSRC520: Cannot open resource token file %s
  284. <li> error RSRC521: UTF8 BOM missing from token file
  285. <li> error RSRC530: Cannot read executable resources from %s
  286. <li> error RSRC531: Failed reading update tokens
  287. <li> error RSRC600: BeginUpdateResource failed on %s
  288. <li> error RSRC601: UpdateResourceW failed on %s
  289. <li> error RSRC602: EndUpdateResourceW failed on %s
  290. </ul>
  291. <table cellpadding=0 cellspacing=0 class=code>
  292. </table>
  293. <p><h1><a name="rsrcIndex">Index</a></h1><menu>
  294. <li><a href="#-a_TextInput">-a TextInput</a>
  295. <li><a href="#-c_UnlocExecutable">-c UnlocExecutable</a>
  296. <li><a href="#-d_TextOutput">-d TextOutput</a>
  297. <li><a href="#-i_Types">-i Types</a>
  298. <li><a href="#-l_LocLang">-l LocLang</a>
  299. <li><a href="#-q">-q</a>
  300. <li><a href="#-r_TextInput">-r TextInput</a>
  301. <li><a href="#-s_Symbols">-s Symbols</a>
  302. <li><a href="#-t_TextOutput">-t TextOutput</a>
  303. <li><a href="#-u_UnlocLang">-u UnlocLang</a>
  304. <li><a href="#-v">-v</a>
  305. <li><a href="#Definitions">Definitions</a>
  306. <li><a href="#RSRC_Command_line">RSRC Command line</a>
  307. <li><a href="#Resource_id">Resource id</a>
  308. <li><a href="#Resource_key">Resource key</a>
  309. <li><a href="#Resource_language">Resource language</a>
  310. <li><a href="#Resource_type">Resource type</a>
  311. <li><a href="#Token_format_-_resource_key_and_header">Token format - resource key and header</a>
  312. <li><a href="#Token_samples_-_default_hex_format">Token samples - default hex format</a>
  313. <li><a href="#Unloc_token">Unloc token</a>
  314. <li><a href="#Use_during_localisation_checkin_process">Use during localisation checkin process</a>
  315. <li><a href="#Use_during_the_build_to_add_resources_to_a_multi-language_executable">Use during the build to add resources to a multi-language executable</a>
  316. <li><a href="#Use_during_the_build_to_update_a_single_language_executable">Use during the build to update a single language executable</a>
  317. <li><a href="#Warnings_and_errors">Warnings and errors</a>
  318. </menu>