CompressionThe first element is to deal with the fact that both PC-DOS / MS-DOS and Windows 3.11 are compressed in the distribution. Looking in an DOS 5.x or Win3.x0 distro file, one sees the signature letters SZDD. The Dos 6 / Win 3.x1 files have here KWAJ. Windows NT and 98 are in MSCF format.
One can make SZDD files using a MS utility hight "compress.exe". This is fairly easy to come by, it basically escaped the Windows 3.1 SDK. The "compress.exe" that comes with the Windows NT resource kit makes MSCF files. One has to go way back to find a compress.exe for the KWAJ format.
To understand what has happened, KWAJ is an older format than SZDD, but is generally better compression. MSCF is generally as good as KWAJ, but appeared later. One might easily suppose that SZDD is native microsoft format, but did not give the same compression ratios as an earlier KWAJ. But because Windows 3.11 and DOS 6 are considerably larger than their DOS 5 / Windows 3.10, the older format was reused to save disk storage. EXPAND 2 (in DOS 6.x), and 2.1 (in Windows 3.11), are there largely to handle both SZDD and KWAJ formats transparently.
One notes also that there is an OS/2 utility DECOMP.EXE, (included in the WLO libraries), which is quite capable of expanding the Windows 3.11 / DOS 6 files. even though the file is quite old. On the other hand, the expand from dos 5.0 or Windows 3.x0 (3.00/3.10/3.30) is incapable of expanding KWAJ format.
The compress.exe for KWAJ is quite rare. I found it in conjuction with the Foxpro distribution Kit. Still, because of fears of it being overwritten, i renamed it to ENCOMP (to match DECOMP). Here is encomp's help screen,
Microsoft (R) Compression Utility - Version 1.02
Copyright (c) Microsoft Corp 1989 - 1991. All rights reserved.
Usage: compress [-aAlg -bceflq$ -sSize -tText -zSize] srcArg [destArg]
-a -- Choices for compression algorithm are: [default = 3]
2 - the Steven Zeck algorithm.
3 - Jeff Johnson's algorithm (LZSS + Huffman).
-be will include each file basename/extension in the header.
-f will force overwriting and recompression of files.
-l will include each file length in the header.
-q will compute compressed file lengths (no output) (ignores -sz flags).
-s will split output into Size x 512 byte pieces naming each piece
with a sequentially higher numerical base name.
-t will include following Text in the header.
Text that includes spaces should be double-quoted.
-z will split off and compress just one piece, and leave the
remainder uncompressed in a second file.
-$ will turn OFF dollar sign renaming. Specific destArg will override.
srcArg can be a filename, a wildcard pattern, or a directory. The
latter will cause a tree walk operation. destArg can be a directory,
a specific filebase, or omitted in which case digits are appended.
You might imagine these to be in a batch condition, where one writes eg "pack winfile.ex e". The default of this version is to rename winfile.exe to winfile.ex$. The $ was changed to _ to match the ISO 9660 file restrictions, mainly.
- DOS6xx: encomp -a3 -l -f %1%2 %1_
- Win3x1: encomp -a3 -b -e -l -f %1%2 %1_
Note that both the DOS and Windows files store length (-l), but only the Windows version stores the filename. This is why the expand.exe from Windows 3.11 supports the -r option (which does not work under DOS files, because the information is not stored in the files.
This is the compress from Windows SDK:
Microsoft (R) File Compression Utility Version 2.00
Copyright (C) Microsoft Corp. 1990-1992. All rights reserved.
Compresses one or more files.
COMPRESS [-r] Source Destination
COMPRESS -r Source [Destination]
-r Automatically rename compressed files.
Source Source file specification. Source may be multiple file
specifications. Wildcards may be used.
Destination Destination file / path specification. Destination may be a
directory. If Source is multiple files and -r is not specified,
Destination must be a directory. Wildcards may not be used.
This produces the SZDD files found in MS/PC DOS 5.00 and Windows 3.00 / 3.10 / 3.11. In general, it is not as tight as the encomp format, and the letter is stored only if the -r option is used. In practice, the last letter is stored, not the full name as under KWAJ format.
Still, the purpose of this is that one should look for version 1 if one wants to make SZDD files, not version 2.
A more recent version comes with the Windows NT reskit files, makes only MSCF format, the format used with Windows NT, 2K, XP, (as individual files), and Win9x (as cabinet-files).
OS/2 uses pack and pack2, but this is not a worry at this stage.
TargetBecause we want to use the -r option of expand.exe, we need to repack DOS files to meet this. DOS 6 setup does not understand SZDD files, because it is a one-shot install. Windows 3.x1 has to understand the older format because the LZEXPAND dll is used elsewhere after install, eg with SZDD files.
We also plan to update some of the dos files, and this is therefore needed.