| CompRes |
|
Welcome to the CompRes page! CompRes was written for Windows NT4/Windows 2000 and its purpose is to compare localized resources in one or two Win32 PE files for completeness, translation errors and other mistakes that can happen during localization and internationalization of a Win32 PE file (aka Win32 exe or dll). CompRes is intended to be used at the end of the build process and simply compares binaries loaded in two different languages. If a resource or part of it is missing in one of the languages, CompRes will raise an error and give you an explanation of the error on stdout (i.e. the command line).
Dowload CompRes version 1.0.1.0 built on 05/04/03
Dowload CompRes version 1.0.0.0 built on 04/21/03
Which types of resources are covered by CompRes?As of version 1.0.2.0, stringtables, menus, accelerators, dialog and dialogex resources are detected and compared by CompRes. Version 1.0.7.0 checks for the existence of al lother resource types. Sorry for Delphi users, unfortunately Borland defined their own proprietary resource format.How does it work?CompRes employs a concept that I borrowed from the windiff tool that ships with the NT Resource Kit or the Platform SDK: The concept of the "left file" and the "right file" which you have to supply both on the command line to CompRes. The background is that I assume that you conceptually consider your domestic language version as the left file and the localized version as the right file (although they can actually be the same files technically, if they contain both resource versions), but this is not really mandatory in a technical sense. However, the badwords file always looks in the resources of the *right* file for bad words.There are two more mandatory command line parameters besides the two file names for left and right file. They denote the languages in which the left and the right file should be interpreted and they are -l=language ID,sublanguage ID and -r=language ID,sublanguage ID Both these two command line parameters expect a 'language ID' and a 'sublanguage ID', separated by a comma, as parameters. The language IDs and sublanguage IDs are nothing else than numbers (defined in the VC or PlatSDK header files, look up the numbers there or in the MSDN help). For instance, the parameters -l=9,1 -r=7,1 mean: "treat the left file as an English (sublanguage U.S. English) file and the right file as a German (sublanguage Germany) file. So if you have two DLLs, fooenu.dll (English resources) and foodeu.dll (German resources) you could compare them using the following command line: compres -l=9,1 -r=7,1 fooenu.dll foodeu.dll The order of the file names is: left file comes first, right file last (just as you would read them from left to right, all people with a different reading order may forgive me my cultural bias here...). Other options are: -e=ExceptionFile: Unicode text file that declares exceptions, i.e. resources that should be ignored during comparison. -b=BadwordFile: Unicode text file that contains "bad words" that may not be in any text item of the right file -d: Ignore differences in style bits of dialogs -f: Ignore differences in font information of dialogs -c: Ignore differences in style bits of dialogs items (controls) -t: Ignore tab order differences in dialogs -i: Check case-insensitive -ie: Ignore a missing exception file (for batch processing) -ib: Ignore a missing badwords file (for batch processing) What the hell is the exception file?With the help of the optional exception file you can instruct CompRes to ignore errors it would otherwise find. The exception file is a Unicode text file that consists out of separate lines, each containing a certain "exception". The first character in each line denotes the type of resource to ignore: 'S' stands for stringtable, 'D' for dialog , 'A' for accelerator and 'M' for menu resource. A '=' must appear next, followed by either the string identifier of the resource or the ordinal number of the resource. String identifiers must be surrounded by double-quotes. In the case of menus or dialogs you can specify a control ID or a menu ID to ignore if you don't want to ignore the whole menu or dialog. More than one stringtable entry can be ignored using commas and hyphens.Examples:
A word about the exit code of CompResIf an error is detected, CompRes fails with a process exit code that is greater than zero and issues an error description to stdout. If everything is okay, CompRes terminates with a process exit code of zero and will issue nothing to stdout.Change Log:
Why I wrote this cool program......well, simply because I had had to fix two very annoying bugs in the beginning of 2003 for my employer, and these were those kinds of bugs that I thought an automated tool should be able to find during the build process prior to shipping the whole product. Hence the idea for CompRes was born.What was technically challenging in writing this program?Nothing if it weren't for the fact that this is the first major program of mine that uses STL. I could again, for the 1.305.768th time, have written a program that makes use of all the fine things that come with MFC and the fine collection classes it has. This way, however I wouldn't have learned anything new for the 1.305.767th time so this time I decided that STL is the name of the game. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Updated on Sunday, 14 June 2009 16:21 |