Instructions on how to create DevPak packages

I’m in the process of writing a DevPak for the libharu libary. These are actually tar.bz2 packages of whatever you think is a good idea to install into the Dev-C++, Code::Blocks or wxDev-C++ IDEs. E.g. precompiled libraries and necessary header files. In addition one adds a so called DevPackage file, which tells the IDEs where to put all the files. Since you are also allowed to install files into the windows directory, these packages are also quite dangerous – you should check the package content first (rename xxx.DevPak to xxx.tar.bz2). The DevPackage file format is more or less straight forward, but first I couldn’t find a documentation for that. In the cvs repository of Dev-C++ there was actually a documentation (File Format.txt), but it contained some errors. So I updated the file and make it available in this post.

                           Dev-C++ Package File Format
                         Version 1 - March the 15th, 2002
                           Update October the 7th, 2008

General Information
-------------------
The content of a DevPak package is described using a package description file,
which has the extension .DevPackage. The file is really a simple INI file.
This is an updated version of the original "File Format.txt" file found
in the cvs repository of Dev C++:
http://dev-cpp.cvs.sourceforge.net/viewvc/dev-cpp/V5/source/packman/File%20Format.txt?view=log
or in the svn repository of wxDev-C++ (or wxDesigner)
http://wxdsgn.svn.sourceforge.net/viewvc/wxdsgn/trunk/packman/File%20Format.txt?view=log

Sections
--------
The .DevPackage file contains three sections:
[Setup]
This section contains information about the package, such as package name,
version, description, readme, license, etc.

[Files]
This section contains information about files, and where they should be
installed to.

[Icons]
This section contains information about links to documentation or webpages
which are added to the Dev-C++ start menu.

The [Setup] section
-------------------
This section *must* contain at least the following keys:
Version     The package format's version number. A higher version number means
            that this package is not compatible with older package managers.
AppName     A name for the package. Example: MyApp
AppVerName  The package's name and the version together.
            Example: MyApp Version 1.0
AppVersion  The package's version number. Example: 1.0
MenuName    A name for a menu group for this package.

The following keys are optional:
Url           An URL to the library's website.
Picture       A filename to a logo/picture/whatever that will be displayed.
Description   A desription for the package.
Readme        A filename to the Readme file, relative to the .DevPackage file.
              Example: README.TXT
License       A filename to the license file, relative to the .DevPackage file.
              Example: COPYING.TXT
Reboot        Wether the package requires a reboot or not in order to function
              properly. The value can be either 1 (true) or 0 (false).
Dependencies  A comma-seperated list of package names that this package
              depends on.

The [Files] section
-------------------
Keys in the Files section are composed in the following format:

Source=Destdir\[FileName][;Flags]

Source (required):
The name of the source file, relative to the .DevPackage file.
This can be a directory, in which case all files inside that directory will be
copied.

Destdir (required):
The destination directory. Please note that Destdir must *always* end with a
backslash (\). Otherwise it will be interpreted as FileName.

FileName (optional):
If this is specified, the copied file will be renamed to the specified filename.

Flags (optional):
An extra set of options.
recursive   If Source is a directory, the installer will recurse into any
            subdirectories and copy the files inside those subdirectories too.
            This doesn't work in Dev-C++, since one one hand the directories
            are copied recursively by default and on the other hand the ";"
            is used in DestDir corrupting the destination filename.

Constants:
Sourcedir and Destdir can contain constants. A constant will be replaced to
their literal value, depending on the user's configuration. The constants'
names are not case sensitive.
<app>  Dev-C++'s root directory (usually C:\Dev-C++).
<src>  The source directory (the directory where the .DevPackage file is
       located).
<win>  The system's Windows directory (usually C:\WINDOWS).
<sys>  The system's Windows System directory (usually C:\WINDOWS\SYSTEM).

Examples:
Foo.txt=<app>\                         Installs to C:\Dev-C++\Foo.txt
Bar.h=<app>\include\FooBar.h           Installs to C:\Dev-C++\include\FooBar.h
L33t.dll=<sys>\                        Installs to C:\WINDOWS\System\L33t.dll
WindowsSucks.exe=<win>\Explorer.exe    Installs to C:\WINDOWS\Explorer.exe
BigFolder=C:\;recursive                Installs all files in BigFolder,
                                       including all files inside any
                                       subfolders, to C:\

The [Icons] section
-------------------
This section is ignored if MenuName (in the Setup section) is not given.

Entries in this section describe what menu items should be created.
Each entry has the following format:

Name=Target[,Icon Filename]

Target can contain constants as described in the Files section.

Examples:
[Setup]
MenuName=GTK
[Icons]
Website=http://www.gtk.org/

This will create the menu group "Start->Programs->Bloodshed Dev-C++->GTK",
with 1 menu item, called Website, which points to http://www.gtk.org/

[Setup]
MenuName=FLTK
[Icons]
UI Designer=<app>\bin\Fluid.exe,<app>\Icons\Fluid.ico
Website=http://www.fltk.org/

Let's assume that Dev-C++ is installed in C:\Dev-C++. This will create the
menu group "Start->Programs->Bloodshed Dev-C++->FLTK", with 2 menu items:
- Website, which points to http://www.gtk.org/
- UI Designer, which points to C:\Dev-C++\bin\fluid.exe, and use the icon
  file C:\Dev-C++\Icons\Fluid.ico

The file can also be downloaded: devpak-format.

1 thought on “Instructions on how to create DevPak packages

  1. Thank you for this information, I could need it, because maye the newer Versions of Allegro should be implemented!!!!!

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.