Inno setup for Delphi packages

As a Delphi developer, you’ve probably used Delphi packages before. Maybe you have also written your own packages. To simplify installation, we use our own Inno Setup script at GDK Software for the installation of these packages. This allows us to build and install Delphi packages via a setup tool, instead of building the packages ourselves. The biggest benefit is the ease of installation; you don’t have to specify the search paths and compile and install the packages yourself.

Below is a short explanation of the script. If you want to get started you can head directly to the Git repository and download the script.

Features:

  • Install, build and register Delphi packages
  • Support for win32 Delphi versions from Delphi 7 to Delphi 10.3 Rio
  • Detect installed Delphi versions, including non-default installation folders
Image for post
Example setup for installed Delphi versions

To use the script you first need to clone the Git repository, or download the two required files (CompileSource.bat and Setup script.iss).

The next step is to configure the Inno Setup script so that the necessary Delphi files are added to the installer. To do that, add all the Delphi files (including the .dpk and.dproj) to the [Files] section of the script. The destination directory of all the source files must be in a subfolder of \Sourcecode\Package\.

Image for post
Sample dpk and dproj

Make sure you also change the defines:

Image for post

After you have changed these lines, it is possible to compile and test the script. The Inno Setup script uses the CompileSource.bat batch file to actually compile the specified package using MSBuild.exe. To debug or test the installation, change the last line of batch file from “rem pause” to “pause”.

Thanks to John Kouraklis for the first version of the script. You can find the original post and version here.

Co-owner of GDK Software, Delphi developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store