windows-nt/Source/XPSP1/NT/sdktools/restools/rlt32/rsrc/rsrc.html

319 lines
18 KiB
HTML
Raw Normal View History

2020-09-26 03:20:57 -05:00
<head><style><!--
h2 {font-style: italic; font-size: 115%; font-weight: bold; margin-top: 0.4in}
p {margin-left: 1 em; margin-top: 0.1in; margin-bottom: 0; border-bottom:0; padding-bottom:0}
pre {margin-left: 2 em}
td {padding-left: 1ex; padding-right: 1ex}
th {padding-left: 1ex; padding-right: 1ex}
table.code {font-size: 88%; line-height:115%; margin-left: 2em}
table.code td {padding-right: 1ex; padding-left: 0}
--></style></head><body>
See <a href="#rsrcIndex">Index</a>
<h2> <a name="RSRC_Command_line">RSRC Command line</a>
</h2>
</p>
<pre>RSRC Executable [-l LocLang] [-u UnlocLang] [-i Types] [-q]
[ [-t|-d] TextOutput [-c UnlocExecutable]
| [-a|-r] text-input [-s symbols] [-v] ]
</pre>
<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)
or dump (-d) from, or containing resources to be replaced (-r)
or appended to (-a).
<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
should be specified as a full hex NLS Language id, for example use
'-l 409' for US English. Required for replace (-r) operation.
<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).
<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
as below:
</p>
<table border align=centre border=2 cellpadding=1 cellspacing=0 style="margin-left:0.6in; margin-top: 0.1in">
<tr align=left><th> Letter <th> Type <th> Letter <th> Type <th> Letter <th> Type
<tr><td> c <td> Cursors <td> g <td> Message tables <td> n <td> INFs
<tr><td> b <td> Bitmaps <td> v <td> Version info <td> h <td> HTML
<tr><td> i <td> Icons <td> a <td> Accelerators <td> x <td> Binary data
<tr><td> m <td> Menus <td> f <td> Font directories <td> <td>
<tr><td> d <td> Dialogs <td> t <td> Fonts <td> o <td> All others
<tr><td> s <td> Strings <td> r <td> RCDATA <td> a <td> All (default)
</table>
<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
of resources processed. -q suppresses all output except warning and error messages.
<p><b><a name="-t_TextOutput">-t TextOutput</a></b><p style="margin-left: 5ex; margin-top: 0">Generate tokens in checkin format.
<p><b><a name="-d_TextOutput">-d TextOutput</a></b><p style="margin-left: 5ex; margin-top: 0">Dump resources in Hex & ASCII format.
<p><b><a name="-c_UnlocExecutable">-c UnlocExecutable</a></b><p style="margin-left: 5ex; margin-top: 0">Compare with unlocalized (English) resources - localised
resources in executable are compared with English resources in
UnlocExecutable. When the localised resource is bit for bit identical
with the English resource RSRC writes a one line unloc
token instead of the full resource. Valid only with tokenise (-t)
option.
<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
text file is added to the executable. Resources already in the executable
are not removed. When a resource from the token file has the same type, id
and language as one in the executable, the executable resource is replaced
by the token resource.
<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
from text file. Requires -l parameter to specify localisation language.
When a resource from the token file has the same type and id as one in the
executable, and the executable resource is US English (409) and the localised
resource is in the language specified on the -l parameter, the US English
resource is removed.
<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
in executable, it will also do so in the named symbol file. Valid only
with the replace (-r) and append (-a) options.
<p>Miscellaneous options
<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
in the token file is ignored during update/append, the file and product
versions from the original unlocalised resources are retained.
</p>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<h2> <a name="Definitions">Definitions</a>
</h2>
<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
resource language. The resource key uniquely identifies the
resource. A Win32 executable can contain any combination of
languages, ids and types so long as no two resources have the
same type, key and language.
<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
predefined, for example menus and dialogs, but apps can and
do use any value they choose.
<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
identify the resource when calling FindResource, LoadString etc.
<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
sub-language, such as 0409 (US English).
<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
key followed by '=lang,cksum' where lang is the unlocalised
language (usually 0409) and cksum is the checksum of the unlocalised
resource. Used when the only difference between the localised and
unlocalised resource is the language in the resource key.
</p>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<h2> <a name="Use_during_localisation_checkin_process">Use during localisation checkin process</a>
</h2>
</p>
<pre>RSRC LocalisedExecutable -c UnlocExecutable -t Tokens -l LocLang [-u UnlocLang]
</pre>
<p>Extracts localized tokens for the specified langauge.
<p>Where a resource in the localised executable is bit for bit identical
to a resource in the unlocalized executable, the resource content is not
written to the token file. In its place RSRC writes an unloc token
giving the checksum of the resource and specifying the target language.
<p>Warnings are generated if the localised executable contains resources
in languages other than that specified by the -l parameter.
<p>Unlocalised resources for comparison are looked up in the unlocalised
executable in the language specified on the -u parameter, default 409
(US ENglish).
</p>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<h2> <a name="Use_during_the_build_to_update_a_single_language_executable">Use during the build to update a single language executable</a>
</h2>
</p>
<pre>RSRC Executable [-u UnlocLang] -r Tokens -l LocLang -s SymbolFile
</pre>
<p>Each localised resource in the token file is added to the executable.
<p>Each corresponding unlocalized resource is removed from the executable.
<p>For each unloc token the unlocalized resource is found in the executable
and its language is updated to the target localized language recorded
in the unloc token.
<p>Tokens of other than the specified localised language are not
processed, but generate warnings.
<p>Warnings are generated for any resources not appearing in both the
executable and token files.
<p>Warnings are also generated for resources of other than the unlocalised
language found in the original executable, and resources of other than
the localised language in the token file.
<p>The unlocalised language defaults to 409 (US English).
</p>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<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>
</h2>
</p>
<pre>RSRC Executable [-u UnlocLang] -a Tokens [-l Language] -s SymbolFile
</pre>
<p>Localised resources from the token file are added to the executable.
<p>For each unloc token the unlocalised resource is found in the executable
and copied for the localised language recorded in the unloc token.
<p>If '-l Languge' is specified, only tokens of that language are added.
When used with the append (-a) option, '-l Language' applies only to
the token file: pre-existing resources in the executable are not affected.
<p>If a resource from the token file matches a resource already in the
executable in type, name and language, the executable resource
is replaced.
<p>Warnings are generated if any token in the executable is replaced, or
if the unlocalised resource corresponding to an unloc token is missing
or has a checksum which differs from the unlocalised resource that was
passed on the '-u' parameter when the toke file was created.
<p>If the '-l Language' option is used, warnings are generated for any
resources of other languages found in the token file.
</p>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<h2> <a name="Token_format_-_resource_key_and_header">Token format - resource key and header</a>
</h2>
<p>A resource may be represented by one or more lines. When
a resource is spread over more than one line, all lines except the
first are indented by three spaces.
<p>The first line of every resource starts with the resource key as follows:
<p>type,id,language;
<p>This is followed by the codepage recorded in the resource directory.
Note that the codepage is not part of the resource key, and is not
maintained consistently by all software. In particular:
</p>
<ul> <li> RC writes the codepage as zero
<li> The NT UpdateResource API writes the codepage as 1252
<li> Locstudio writes a codepage that corresponds to the resource language
</ul>
<p>Winnt.h documents the codepage as follows:
<p>"Each resource data entry ... contains ... a CodePage that should be
used when decoding code point values within the resource data.
Typically for new applications the code page would be the unicode
code page.'
<p>In practise I have never seen the codepage value set to Unicode (1200).
<p>If the '-c' (unlocalised comparison) parameter was provided on the
rsrc command, and there was an unlocalised resource with the same type
and id, the language and checksum of that unlocalised resource are
appended.
<p>Finally, the resource data is represented in one of the forms below,
or as 'unloc' if the resource data exactly matches the unlocalised resource
found in the file passed by 'c'.
<p>There are thus three possible token key/header formats as follows:
</p>
<pre>type,id,language;codepage;resource-data
</pre>
<p>Resource recorded in full, either no '-c' parameter specified, or
resource does not exist in unlocalised file.
</p>
<pre>type,id,language;codepage,unlocalised-checksum,language;resource-data
</pre>
<p>Resource recorded in full, '-c' parameter was specified, and localised
resource image differed from unlocalised resource image.
</p>
<pre>type,id,language;codepage,unlocalised-checksum,language;'Unloc'
</pre>
<p>Resource recorded in full, '-c' parameter was specified, and localised
resource image was identical to unlocalised resource image.
</p>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<h2> <a name="Token_samples_-_default_hex_format">Token samples - default hex format</a>
</h2>
<p>For most resource types, RSRC generates resources
as a string of hex digits.
<p>For example, the following represents an accelerator resource.
</p>
<pre>0009,0002,0409;00000000;Hex;00000020:030074008e00000003002e00840000000b0044008400000087002e0084000000
</pre>
</p>
<ul> <li> Type 0x0009 (Accelerator)
<li> Id 0x0002
<li> Language 0x0409 (LANG_ENGLISH, SUBLANG_US)
<li> Codepage 0 (implies resource was probably generated by RC)
<li> Length in bytes 0x0020
</ul>
<p>The resource is short, so its hex representation follows the length.
<p>A larger binary resource is represented on multiple lines as follows:
</p>
<pre>000a,4000,0409;00000000;Hex;0000016a
00000000:0000640100004c0000000114020000000000c000000000000046830000003508000050130852c8e0bd0170493f38ace1bd016044d085c9e0bd01003000000000000001000000000000000000000000000000590014001f0fe04fd020ea3a6910a2d808002b30309d190023563a5c000000000000000000000000000000000065
00000080:7c15003100000000003025a49e308857696e6e74000015003100000000002f25d3863508466f6e747300000000490000001c000000010000001c0000003900000000000000480000001d0000000300000063de7d98100000005f535445504853544550485f00563a5c57494e4e545c466f6e7473000010000000050000a02400
00000100:00004200000060000000030000a05800000000000000737465706800000000000000000000004255867d3048d211b5d8d085029b1cfa4119c94a9f4dd211871f0000000000004255867d3048d211b5d8d085029b1cfa4119c94a9f4dd211871f00000000000000000000
</pre>
</p>
<ul> <li> Type 0x000a (RCDATA)
<li> Id 0x4000
<li> Language 0x0409 (LANG_ENGLISH, SUBLANG_US)
<li> Codepage 0
<li> Length in bytes 0x016a
</ul>
<p>The hex representation is split onto multiple lines each of 128 bytes.
</p>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<h2> <a name="Warnings_and_errors">Warnings and errors</a>
</h2>
</p>
<ul> <li> warning RSRC100: Localised resource has no corresponding unlocalised resource in %s
<li> warning RSRC110: Unlocalised resource from token file appended to executable
<li> warning RSRC111: Unlocalised resource from token file replaced unlocalised resource in executable
<li> warning RSRC112: Localised resource from token file replaced localised resource already present in executable
<li> warning RSRC113: Localised resource from token file appended to executable - there was no matching unlocalised resource
<li> warning RSRC120: Token file resource does not match specified language - ignored
<li> warning RSRC121: Token file resource is not a requested resource type - ignored
<li> warning RSRC122: executable unlocalised resource checksum does not match checksum recorded in token file for resource %s
<li> warning RSRC124: missing executable unlocalised resource for %s
<li> warning RSRC125: executable contains no unlocalised resource corresponding to resource %s
<li> warning RSRC160: Symbol file does not match exectable
<li> warning RSRC161: Symbol file not processed
<li> warning RSRC162: Could not reopen executable %s to update checksum
<li> warning RSRC163: Failed to write updated symbol checksum
<li> warning RSRC170: No localizable resources in %s
<li> warning RSRC171: could not close executable
</ul>
</p>
<ul> <li> error RSRC230: 'Unloc' token is missing unlocalised resource information for %s
<li> error RSRC231: Failed to apply unloc token
<li> error RSRC232: Failed to apply token
<li> error RSRC300: Hex digit expected
<li> error RSRC301: Hex value too large
<li> error RSRC302: Unexpected end of file
<li> error RSRC303: \'%s\' expected
<li> error RSRC304: newline expected
<li> error RSRC310: Unrecognised resource type for resource %s
<li> error RSRC400: -t (tokenise) option excludes -d, -a, -r, and -s
<li> error RSRC401: -d (dump) option excludes -t, -u, -a, -r, and -s
<li> error RSRC402: -a (append) option excludes -t, -d, -u, and -r
<li> error RSRC403: -r (replace) option excludes -t, -d, -u, and -a
<li> error RSRC404: -r (replace) option requires -l (LangId)
<li> error RSRC405: Analysis excludes -s
<li> error RSRC420: Update failed.
<li> error RSRC421: Token extraction failed.
<li> error RSRC422: Analysis failed.
<li> error RSRC500: Corrupt executable - resource appears more than once
<li> error RSRC501: %s is not an executable file
<li> error RSRC502: %s is not a Win32 executable file
<li> error RSRC503: No resources in %s
<li> error RSRC510: Cannot open executable file %s
<li> error RSRC511: cannot find resource directory in %s
<li> error RSRC512: Cannot create resource token file %s
<li> error RSRC513: Cannot open unlocalised executable file %s
<li> error RSRC514: cannot find resource directory in unlocalised executable %s
<li> error RSRC515: cannot write delta token file %s
<li> error RSRC516: cannot write stand alone token file %s
<li> error RSRC520: Cannot open resource token file %s
<li> error RSRC521: UTF8 BOM missing from token file
<li> error RSRC530: Cannot read executable resources from %s
<li> error RSRC531: Failed reading update tokens
<li> error RSRC600: BeginUpdateResource failed on %s
<li> error RSRC601: UpdateResourceW failed on %s
<li> error RSRC602: EndUpdateResourceW failed on %s
</ul>
<table cellpadding=0 cellspacing=0 class=code>
</table>
<p><h1><a name="rsrcIndex">Index</a></h1><menu>
<li><a href="#-a_TextInput">-a TextInput</a>
<li><a href="#-c_UnlocExecutable">-c UnlocExecutable</a>
<li><a href="#-d_TextOutput">-d TextOutput</a>
<li><a href="#-i_Types">-i Types</a>
<li><a href="#-l_LocLang">-l LocLang</a>
<li><a href="#-q">-q</a>
<li><a href="#-r_TextInput">-r TextInput</a>
<li><a href="#-s_Symbols">-s Symbols</a>
<li><a href="#-t_TextOutput">-t TextOutput</a>
<li><a href="#-u_UnlocLang">-u UnlocLang</a>
<li><a href="#-v">-v</a>
<li><a href="#Definitions">Definitions</a>
<li><a href="#RSRC_Command_line">RSRC Command line</a>
<li><a href="#Resource_id">Resource id</a>
<li><a href="#Resource_key">Resource key</a>
<li><a href="#Resource_language">Resource language</a>
<li><a href="#Resource_type">Resource type</a>
<li><a href="#Token_format_-_resource_key_and_header">Token format - resource key and header</a>
<li><a href="#Token_samples_-_default_hex_format">Token samples - default hex format</a>
<li><a href="#Unloc_token">Unloc token</a>
<li><a href="#Use_during_localisation_checkin_process">Use during localisation checkin process</a>
<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>
<li><a href="#Use_during_the_build_to_update_a_single_language_executable">Use during the build to update a single language executable</a>
<li><a href="#Warnings_and_errors">Warnings and errors</a>
</menu>