jrsoftware.org // Jordan Russell's Software
-Home

Products

-Inno Setup


-Toolbar2000

-Toolbar97

-StripReloc

-More...

Support

-Newsgroups

-Contact Me

#######
visitors since
Jan. 1998

Inno Setup Knowledge Base
Return to index

HOWTO: Deploy BDE (Borland Database Engine)

Article Created: 2003-10-15 19:09 GMT by Jordan Russell
Last Updated: 2007-02-18 00:59 GMT by Jordan Russell


It is possible to install BDE from a 32-bit Inno Setup installation. Follow these steps:

  1. Download MiniReg.exe [13KB, source] to your installation's source directory (typically the directory containing your script file). MiniReg.exe is a utility I (Jordan Russell) wrote that contains a subset of the functionality in Microsoft's REGSVR32.EXE. (REGSVR32.EXE is not used since it does not come preinstalled on the first release of Windows 95.)
  2. Extract the BDEINST.DLL file from BDEINST.CAB, located in Program Files\Common Files\Borland Shared\BDE. To do this, either use WinZip or type "EXTRACT BDEINST.CAB" at the command line. (If BDEINST.CAB doesn't exist in your BDE directory, click here to download version 5.11 [3581 KB, md5sum e8a51ce7a07bbece55dad9307c65e224].)
    (Note: You may want to consider applying a patch to work around a known bug with the BDE installer's disk space check.)
  3. Move the extracted BDEINST.DLL to your installation's source directory.
  4. Add these lines to your script:
    [Files]
    Source: "MiniReg.exe"; DestDir: "{tmp}"
    Source: "BdeInst.dll"; DestDir: "{tmp}"
    
    [Run]
    Filename: "{tmp}\MiniReg.exe"; Parameters: """{tmp}\BdeInst.dll"""
    

What about creating aliases?

  • Ralf Walhöfer has supplied a program called AddAlias (~30KB, 2001-01-08) which does just that. Instructions and source code are included. To use it in an installation:
    • In your script's [Files] section, copy the AddAlias program to {tmp}, like MiniReg.exe and BdeInst.dll.
    • In your script's [Run] section, execute {tmp}\AddAlias.exe after MiniReg.exe.
  • You could write a small Delphi program that executes in your script's [Run] section that calls either TSession.AddAlias or DbiAddAlias to add the desired alias(es). Or you could integrate this in your application; it could create the necessary alias(es) at startup.

    Darko Ivancevic has supplied this Delphi code for creating an alias (untested by me).
    procedure CreateAlias;
    const
      FDbDriver = 'PARADOX';
      SubDir = 'Data';
    var
      FAlias: string;
      FAliasDir: string;
    begin
      FAlias := 'aLog2000';
      Session.ConfigMode := cmPersistent;
      if not Session.IsAlias(FAlias) then
      begin
        FAliasDir := ExtractFilePath(ParamStr(0)) + SubDir;
        Session.AddStandardAlias(FAlias, FAliasDir, FDbDriver);
        Session.SaveConfigFile;
      end;
    end;
    

What about installing SQL Links?

From Holger Erne:
If you install BDE via the BDEINST.DLL method described in your
how-to, most of the required files will get installed (i tested
this with bdeinst.dll V5.1.1.1, file size 3,67 MB (3.853.824 Bytes)).
You just have to add the SQL-Drivers itself and register them
via some registry entries.

I use the following procedure (assuming BDE&SQL-Links are 
installed on your local hard disk in <BDEPATH>):

1. Source Machine (your development system)
===========================================
a) Read the file bdedeploy.txt in your <BDEPATH>. It contains
   information on what files you need to redistribute to
   support a special database

Example: SQL-Links drivers for Interbase:

  SQLINT32.DLL    Interbase driver
  SQL_INT.CNF     BDE-config file for Interbase driver

b) Run regedit and look into 
HKEY_LOCAL_MACHINE\Software\Borland\Database Engine\Setting\Drivers
   Select the subkey matching your Database driver (e.g. Interbase:
   subkey "INTRBASE"). Export the subkey (including all subkeys)
   via Registry->Export into a file (e.g. Interbase.reg).

2. Installing on the target machine
===================================

a) Install BDE via the BDEINST.DLL method
b) Copy SQL-Links drivers (files from 1.a)) to your target machines
   BDE-Installation directory (you can get the directory from
HKEY_LOCAL_MACHINE\Software\Borland\Database Engine\DLLPATH)
c) Run the registry script (file created in 1.b)) 

Of course, you can automate the steps in 2.a)-2.c) via your setup
program. Add drivers from (a) and the registry script from (b) [you 
may also add the registry settings to your installation script - do 
as you like...] to your installation sources and build your 
installation program.


NOTE: Although these procedures work well for me, do not make me
responsible, if they won't work for you!

Can I suppress the dialog box which asks the user to select a directory?

With this method of installing BDE, I don't think so.

Will BDE be removed when I uninstall my program?

Unfortunately, no.

And it's not a good idea to use an [UninstallDelete] entry to wipe out the BDE directories, because other applications the user has installed might depend on BDE also.

On some machines I get a message from the BDE installer stating that there isn't enough free disk space even though there is plenty.

This is a known integer overflow bug in BdeInst.dll for which, to my knowledge, Borland never released a fix.

I, however, have devised a one-byte patch for BdeInst.dll version 5.11 that disables the broken disk space check: BdeInstDiskSpacePatch.zip [24 KB, md5sum 5c5b0091406f283b63d13a4283e2f91b]. To apply, unzip and run BdeInstDiskSpacePatch.exe from the same directory as BdeInst.dll.

Please note that this patch is unofficial and is not endorsed by Borland in any way. Use at your own risk/discretion.

bdedeploy.txt states that only "Borland-certified install programs" may install BDE. Inno Setup isn't Borland-certified.

It is true that Inno Setup isn't Borland-certified. However, with the method of BDE installation presented in this article, Inno Setup isn't installing BDE -- Borland's own BdeInst.dll handles all of the file installation and registry entry creation. Because Inno Setup isn't installing/altering anything BDE-related, it clearly need not be certified.

Site contents Copyright © 1997-2012 Jordan Russell. All rights reserved.