Windows 3.11 File Installation and Decompression Library

In Microsoft Windows 3.11, file decompression and installation routines were primarily handled by the dynamic link library LZEXPAND.DLL, working in tandem with the version installation library VER.DLL. Together, these 16-bit system libraries provided standard Application Programming Interfaces (APIs) for unpacking compressed software archives and safely installing updated files onto the system. This article explains the technical roles of these libraries, their underlying compression mechanisms, and how they automated file deployment during the Windows 3.x era.

The Role of LZEXPAND.DLL

LZEXPAND.DLL served as the dedicated data decompression engine in Windows 3.1 and Windows 3.11. Software distributed on floppy disks often faced severe capacity limits, requiring installation files to be compressed using Microsoft's command-line tool COMPRESS.EXE. Compressed files typically had their file extensions modified by replacing the final character with an underscore (for example, SYSTEM.IN_ or KRNL386.EX_).

When an installer needed to read or unpack these compressed assets, it called routines in LZEXPAND.DLL. This library implemented a variant of the Lempel-Ziv (LZ77) compression algorithm and exposed file-handling functions designed to mimic standard DOS input/output operations:

  • LZOpenFile: Opened both compressed and uncompressed files transparently.
  • LZCopy: Read a compressed source file, decompressed it in real time, and wrote the expanded output to the destination directory.
  • LZRead and LZSeek: Handled block reading and seeking within compressed data streams.

Because LZEXPAND.DLL handled decompression transparently, applications could process packed files without custom extraction code.

The Role of VER.DLL in File Installation

While LZEXPAND.DLL executed the physical decompression, VER.DLL acted as the high-level installation manager. It enforced safe deployment practices by inspecting embedded version resources inside executable files and dynamic link libraries.

The primary installation routine in VER.DLL was VerInstallFile. This function integrated directly with LZEXPAND.DLL to automate complex installation workflows:

  1. Version Checking: VerInstallFile extracted and compared the version timestamps and product version data of both the incoming file and any existing destination file to prevent older libraries from overwriting newer ones.
  2. Decompression: If the incoming file was compressed, VerInstallFile invoked LZEXPAND.DLL to decompress the contents into a temporary directory.
  3. Collision Detection: It validated whether the file was currently in use by another running Windows process.
  4. Final Deployment: Upon successful validation, it renamed and moved the decompressed file to its target system directory.

By standardizing these routines across LZEXPAND.DLL and VER.DLL, Microsoft established a unified setup architecture that reduced disk footprint and prevented library version conflicts across Windows 3.11 installations.