Subject Re: [firebird-support] Install of UDF dll
Author Helen Borrie
At 11:22 PM 28/08/2004 -0400, Don Gollahon wrote:
>I have read many articles on UDFs in this group but none seem to deal with
>how to install the dll.

Perhaps because it's not a question of "how to install the dll" but "how to
configure the server". There are three levels of security for the location
of external libraries, of which the most risky is FULL. It allows the
server to access an extlib anywhere in the physical filesystem and requires
that the database declaration include the full path to the dir containing
the dll (or so, in the case of posix). The most restrictive is NONE, which
doesn't allow use of external libs at all.

The medium is RESTRICT, which requires the paths to each dir where extlibs
can be accessed. If the location is within the Firebird "tree", the paths
can be relative. And so it is with the default: in firebird.conf you will
see that the parameter for UDFAccess is RESTRICT and the path is UDF, i.e.
it is the ../UDF dir, relative to the root. It is the RESTRICT setting
that enables you to declare the module_name without path or extension.

You can uncomment the default setting and append other paths and/or remove
the default path. So, to make the server look in a location c:\MyUDFLibs
in case it doesn't find the module_name in $RootDirectory\UDF, do this:


>I need to install a UDF dll with my app install. I
>don't want the user to have to copy a dll to the right place. I will make a
>separate install for the server and the client. But how do I get the path
>to the FB area on the server that the user used?

From the server, you don't (can't). You're going to have to hold these
variables in your installer and update firebird.conf via a filesystem
method to append the alternative path.

>Granted, they will most
>likely use the defaults but as soon as I say that, someone won't. And what
>if in the future the directory name for FB changes like it has a few times
>in the past?

Not a problem. Keep the UDF dir setting as a relative path setting and
only hard-code your user's custom settings

> I thought the FB install created a Firebird environment variable to
> designate this path but I don't see one in my installs.

No, there has never been an environment variable to designate the extlib
path. That would be asking for trouble.

You can optionally install the FIREBIRD environment variable, which is a
string consisting of the hard path to the directory where firebird.conf is,
that has \bin, \UDF, etc. etc. beneath it. But, on the Windows standard
install, you don't need it, as the path is installed in the registry when
the script runs instreg.exe. Instreg is clever enough to know that, if
it's being run from the ..\bin dir (as it must be) then its parent is the
root path, whatever it's called. That's why, with the standard installer,
if you set a different installation path, instreg will still get the
registry entry right.

IMO, if you write an installer that lets your users bung UDFs in any old
place, you're not doing them or yourself any favours.