Subject FB2.5 How does FBClient locate firebird.conf and firebird.msg
Author wadeauch
FB2.5

To avoid the issues related to distributing an application that relies on FB, it is our intention to install our own copy of FB beneath our application folder and from there modify the firebird.conf appropriately and then install our own service for FB.

As well as changing the port number on which our FB instance will listen, we intend to change the IpcName so that a local connection from our FBClient talks to the correct server instance.

It appears that FBServer looks up one folder from the server exe for firebird.conf. FBClient however seems to look at registry "DefaultInstance" key and if this exists (e.g. pointing to a FB1.5 installation) then this is where it pulls its firebird.conf and firebird.msg. If the "DefaultInstance" key is not set then it appears to look one folder above where fbclient.dll is located. FBEmbed.dll may look in the same folder at itself - who knows for sure.

Two easy ways to test for problems are:

(1) GBAK, perform a restore to where a database exists and don't specify the '-rep' switch. If it finds the firebird.msg via "DefaultInstance" registry key then the message returned will indicate a problem with the message file. This can be resolved by setting the environment variable FIREBIRD_MSG.

(2) From an application, do a local connection (Trying to connect to FB2.5 which a different IpcName). It will fail. Clearly fbclient.dll is looking at "DefaultInstance" in the registry and reading the FB1.5 file. Renaming the "DefaultInstance" key causes fbclient to look for firebird.conf in the folder above itself and hence get the correct IpcName.

Given that the DefaultInstance key may exist outside our control and will likely point to the wrong FB version, how is it possible to control how FBClient finds both these files? Same question for fbembed.dll.

I there some definitive documentation on how FBServer, FBClient and FBEmbed determine the location for firebird.conf and firebird.msg?