Petite v1.2 - Copyright (c) 1998 Ian Luck. All rights reserved. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Files that you should have found in the Petite package ====================================================== PETITE.EXE The executable PETITE.TXT This file REGISTER.TXT Registration details REGISTER.EXE Registration program FILE_ID.DIZ BBS description file What's the point? ================= Petite is a Windows 95/NT executable compressor. It allows compression of the whole executable - code, data and resources. Petite automatically decides which parts of the executable can be compressed and which parts need to be left as they are. The compressed output executable can be run as if it was the original uncompressed executable. Why Petite? =========== The file format of Win32 (Windows 95/NT) executables is called the "Portable Executable" file format, "PE" for short. Petite means "of small and dainty build", which kind of describes the executables after they've been compressed! And, Petite obviously begins with "PE"! Clever huh? :) Main Features ============= * Compresses all Win32 PE files - including EXE, DLL, DRV etc... * Automatic compression decision making - decides which parts are compressable and which are not * Resource compression - user selectable which resource types to compress * Section joining & Data moving - further reduces the file size slightly * 100% Assembler decompression code - no noticeable delay at load time in most cases * Command-line driven - allows use from within compilers and makefiles Command-Line Options ==================== -i Display file information: Displays a list of the sections in the file and a list of the resource types used. Also displays information on how much of the file is compressable. -o Set output filename: Sets the compressed output filename. -b<0|1> switch: Backup original file: Renames the original file to "file.BAK". Backups are disabled when the "-o" option is used. 0=OFF, 1=ON (default: ON) -r Select resource types for compression: (default: NONE) ... SEE BELOW FOR DETAILS -l Leave all sections in file: Stops Petite joining compressed sections together. -f Place decompression code at start of file: Places the decompression code at the start of the file, rather than at the end. There is no particular reason why you should want to put the code at the start, except if for some reason you want to join additional data to the current end section. -p<0|1> switch: Display compression progress: Disables/enables the displaying of the compression progress counter. 0=OFF, 1=ON (default: ON) -y Overwrite existing files -n Don't overwrite existing files NOTE: You can use wildcards and multiple filenames in the command-line. If you use a filename with any spaces then the whole filename must be enclosed in quotes. Valid examples: petite *.exe -b0 -r* petite -l "my file.dll" -ob.dll petite -f a.drv b* c.exe petite -y "*.dll" -b0 petite a*.exe b.exe -l -f -p0 Compressing Resources ===================== All resources are grouped into types, which can be either a number or a word. To see a list of the resource types used in a file you should run Petite using the '-i' (display information) and '-r' (compress resources) options. eg: petite blah.exe -i -r The resource types selected for compression must be seperated by a comma without any spaces. Valid examples: petite ... -r2 compress only bitmaps petite ... -r2,10 compress bitmaps and user data petite ... -rmytype compress "mytype" resources petite ... -r2,mytype compress bitmaps and "mytype" res petite ... -r* compress all resources except 3,14,22,16 Common resource types are listed below. It is recommended that you don't compress icon resources (types 3,14,22), otherwise the program's icon will not be visible in the Start menu or a directory listing. Also, version information (type 16) should not be compressed as it would be needed if a program wanted to check the version of the file. "*" can be used to respresent all resource types other than 3, 14, 22 and 16. Whichever resources you choose to compress, you should make sure the new compressed file loads properly before deleting the original file. It is probably wise to be on the safe side and test all files you compress with Petite before deleting the original. Standard Resource Types ----------------------- 1 Cursor 2 Bitmap 3 Icon 4 Menu 5 Dialog 6 String 7 Font directory 8 Font 9 Accelerator 10 User resource data 11 Message table 12 Cursor directory 14 Icon directory 16 Version info 21 Animated cursor 22 Animated icon Building an excutable with Petite ================================= Because Petite is command-line driven it can easily be used within a compiler's build process or makefile. The only extra things you have to do is use the '-p0' (progress off) option and possibly the '-y' (overwrite) option. Using Petite with Visual C++ ---------------------------- 1) Open the "Project Settings" dialog (press Alt-F7) and select the project configuration you wish to produce a compressed executable. 2) Goto the "Link" page and remove the ".exe" extension from the "Output file name". eg: "Release/blah.exe" -> "Release/blah" 3) Goto the "Custom Build" page and enter the following "Build command": "petite -p0 -y $(InputPath) -o$(InputPath).exe" (+extra options) 4) Enter the following "Output file": "$(InputPath).exe" If you wish to compress a DLL, rather than an EXE, then replace all cases of "exe" above with "dll". NOTE: You should make sure Petite is in the path. This is most easily achieved by copying PETITE.EXE into the Windows directory. Latest Version ============== The latest version of Petite can always be found at the Petite homepage : http://www.icl.ndirect.co.uk/petite/ Credits ======= The compression method used in Petite is developed from the ZLIB library by Jean-loup Gailly & Mark Adler. Copyright, Disclaimer etc... ============================ Petite is not free, it is SHAREWARE. You are allowed 21 days to evaluate it and decide if it's of any use to you. If you want to continue using it after this period you must register. See REGISTER.TXT for details. This software is provided as-is, without warranty of ANY KIND, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The author shall NOT be held liable for ANY damage to you, your computer, or to anyone or anything else, that may result from its use, or misuse. Basically, you use it at YOUR OWN RISK. Use of this software indicates that you agree to the above conditions. You may freely copy and distribute Petite as long as NO FEE is charged and all the files remain intact AND unmodified. All trademarks and other registered names contained in the Petite package are the property of their respective owners. History ======= 1.2 - 25/6/98 ------------- * Further optimized decompression code * Petite becomes a Win32 only executable (no longer DOS) * Fixed NT bug, and a few other special case bugs 1.1 - 27/5/98 ------------- * Data moving * Resource type "*" * Fixed occasional section joining bug 1.0 - 22/5/98 ------------- First Release Bug Reports, Suggestions, Coments, Problems etc... ================================================== If you have any of the aforementioned you can email : petite@icl.ndirect.co.uk