From FreeDOS
Jump to: navigation, search

Package files provides an easy way to install new software on FreeDOS. Packages should only include subdirectories of the install target. For example, do not specify C:\FDOS in the path. The install target may be referred to after installation using the %DOSDIR% variable.

Package filenames

Packages names must follow some basic rules. They shall be max. 8 letters long (but should not be too short either, since a 1 or 2-letters package name might be confusing), and must not be composed of characters others than a-b, 0-9 or '_'. This for backward compatibility with short file names (8+3) and ISO 9660 file systems (used on CDROMs). The package filename is always followed by the .ZIP extension.

Package files

FreeDOS uses Zip files as the package file format. We chose Zip files for several reasons, not the least of them the fact that Zip files under DOS have become the de facto way to distribute collections of files. The Zip file format is well known, well supported, and in the public domain. FreeDOS prefers Info-ZIP to create packages. FreeDOS packages must contain exclusively files fitting the 8+3 convention (ie. 8 letters maximum for the filename and 3 letters max for the extension) due to legacy concerns.

Here below is the RECOMENDED command line that can be used to create a package for a program named EXAMPLE:

ZIP −9 -r -k EXAMPLE.ZIP subdir1 subdir2 ... subdirN

If you are using 7za to create your packages, use this:

7za a -mm=deflate -mx=9 -tzip EXAMPLE.ZIP subdir1 subdir2 ... subdirN

Note, that 7za allows to use a different compression algorithms. The FreeDOS package manager (FDNPKG) supports two compression methods: Deflate and LZMA. Usually LZMA provides better compression than Deflate, however it is not recommended for general use because LZMA decompression requires much more memory than Deflate. LZMA decompression needs about 24MiB of memory, which is often more than the total available memory on most DOS systems. LZMA might be used for packages that assume high-end systems (for example: 3D games, etc). But it's always safer to stick to Deflate.

Nevertheless, if you wish to create a package using LZMA, use this:

7za a -mm=lzma -tzip EXAMPLE.ZIP subdir1 subdir2 ... subdirN

FreeDOS 1.1 package structure

FreeDOS 1.1 uses a single package file that includes binary and source code. The Installer can choose to not unpack sources at install time.

The directory structure is otherwise the same as 1.0:

Put the program's LSM file here.
Binaries, such as exe and com files. Programs only.
Package documentation, with each package having its own directory.
The help files.
Optional localizations (NLS language files) of the package.
The complete source code (when installed) with each package having its own directory. (For example, SOURCE\CHOICE).

Third-party, non-FreeDOS packages

Files that are not part of the core FreeDOS system (ie. 3rd party programs, games, etc), can also be packaged using the same format described above, although they will probably need to have all files in their own directory most of the time. For example, if we were to consider a package FOO containing a program that is not part of the FreeDOS core, we might end up with a package having the following structure:

Package meta file for the FOO program
The program's executable
Some documentation
Data file used by the FOO program
A "Link" file, see the "links" documentation section for details
here would be stored all source files for foo

Note the 'PROGS' directory above. This is a category to which the package belong. The package installer might change this directory at install time, depending on the user's preferences. Possible categories are listed below:

Category      Description
DEVEL Development tools (mostly compilers)
PROGS User programs, tools...


Many utilities are meant to be used from the command line to work on files. Such tools are often expected to be somewhere in the %PATH%, so one do not need to switch to the directory where the said utility is stored to use it. A good example of such tools are archivers (like zip, unrar...), but there are others, too. For such tools, the FreeDOS package format provides a "linking" provision. A package that wishes to put one or more of its executable in the %PATH%, will have to contain a LINKS directory, and in this directory a batch file for every executable that needs to be linked to %PATH%. The batch file must contain ONLY the path and filename to the target executable (as stored in the zip package). During installation, the FreeDOS package manager will substitute these batch files with proper content.

FreeDOS 1.0 package structure

This section is describing an obsolete package format - it shouldn't be used. Present here only for archaeological purposes.

FreeDOS 1.0 used separate packages for binaries ("pkg") and source code ("spkg"). The below directories are subdirectories of the base install directory. This format is obsolete, and should not be used for any new packages!

Binary packages used this directory structure:

Put the program's LSM file here. The LSM file must have the exact same name as the package filename (except for the file's extension, of course).
Binaries, such as exe and com files. And if a program is made of of a bat file, then that goes in BIN too. Programs only.
Package documentation, with each package having its own directory (for example, DOC\CHOICE). This allows a complicated package such as a compiler or programmable editor to include more than just a readme (perhaps sample code for the compiler, technical notes or other references, etc.)
The help files.

Source packages used this directory:

The complete source code (when installed) with each package having its own directory. (For example, SOURCE\CHOICE).