Recent

Author Topic: Firebird 5 client without install  (Read 10815 times)

calm_sea

  • Jr. Member
  • **
  • Posts: 56
Firebird 5 client without install
« on: March 25, 2024, 08:37:56 am »
Hi everyone. My client application does not reside on the server. If I also install Firebird on the client it works, but if I only copy fbclient.dll to windows\system32 or in any case in the path it doesn't work. What is the minimum set of files to include so as not to have to install firebird on the client too? I couldn't find anything on the documentation.

rvk

  • Hero Member
  • *****
  • Posts: 7045
Re: Firebird 5 client without install
« Reply #1 on: March 25, 2024, 08:54:51 am »
It happens that such instructions (for 'embedded' Firebird 5) was just posted yesterday  ;)
https://forum.lazarus.freepascal.org/index.php/topic,64344.msg512202.html#msg512202

And if you DO have a real server... well... then you just need to run the client installation.
It copies a lot more than just fbclient.dll.
(Also, with copying a fbclient.dll to windows\system32 you might up copying the wrong bitness, crippling any Firebird application.


Hi, I share my experience on using embedded Firebird 5 in a Lazarus application (Window 10). I hope this could helps, maybe it could be even more useful to update the https://wiki.freepascal.org/Firebird.

Download Firebird kit from https://firebirdsql.org/. I used "Firebird-5.0.0.1306-0-windows-x64.zip" for this testcase.

Create a new Lazarus project and in its folder extract the following files/folders from the zip:
  • /intl
  • /plugins
  • fbclient.dll
  • firebird.conf
  • firebird.msg
  • ib_util.dll
  • icu*.*
  • msvcp140.dll
  • vcruntime140.dll
  • EMPLOYEE.FDB <-- sample database to use in the application (path in the zip: /examples/empbuild/)
In the Lazarus project, add the following components:
  • IBConnection1
  • SQLTransaction1 --> set its Database property to IBConnection1
  • SQLQuery1 --> set its Transaction property to SQLTransaction1
  • DataSource1 --> set its DataSet property to SQLQuery1
  • DBGrid1 --> set its DataSource property to DataSource1 and adjust it to the form
Add also Button1 and populate its OnClick event with the following code:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   IBConnection1.HostName:= '';
  4.   IBConnection1.UserName:= 'SYSDBA';
  5.   IBConnection1.Password:= 'masterkey';
  6.   IBConnection1.DatabaseName:= ExtractFileDir(ParamStr(0)) + '\EMPLOYEE.FDB';
  7.   IBConnection1.Connected:= True;
  8.   SQLQuery1.SQL.Text:= 'select RDB$Relation_Name from RDB$RELATIONS where RDB$Relation_Name not like ''%$%''';
  9.   SQLQuery1.Open;
  10. end;

That's all: press F9 to compile+run the application and then press Button1 --> the grid should connect to EMPLOYEE.FDB through the embedded engine and list all its tables (this is obviously just a small proof of concept).
« Last Edit: March 25, 2024, 08:57:05 am by rvk »

rvk

  • Hero Member
  • *****
  • Posts: 7045
Re: Firebird 5 client without install
« Reply #2 on: March 25, 2024, 09:03:54 am »
Also see: https://firebirdsql.org/rlsnotesh/install2-win-clientonly.html

Both client and server depend on the C/C++ runtimes.

And if you really only want to do a client install with copying a dll, don't copy to the Windows directory (unless you know what you are doing). Just place the dlls (and other needed files) in the same directory as your .exe file.

calm_sea

  • Jr. Member
  • **
  • Posts: 56
Re: Firebird 5 client without install
« Reply #3 on: April 03, 2024, 02:06:11 pm »
No way. Everything works well only if I run at least the Firebird minum install client only  I'll do it in this way. The reason I tried to avoid it, is that I wanted to make a client entirely on a USB stick without any install

rvk

  • Hero Member
  • *****
  • Posts: 7045
Re: Firebird 5 client without install
« Reply #4 on: April 03, 2024, 02:13:00 pm »
No way. Everything works well only if I run at least the Firebird minum install client only  I'll do it in this way. The reason I tried to avoid it, is that I wanted to make a client entirely on a USB stick without any install
You would at least need the requirements of Firebird itself.
And that's the C/C++ runtimes.
Without those installed it won't work.

BTW. Instead if running the Firebird minimal client install, you can also install those requirements yourself silently.

The minimal install does the same thing.
Part of win32/FirebirdInstall.iss:

Code: INI  [Select][+][-]
  1. [Run]
  2. ; due to the changes required to support MSVC15 support for earlier versions is now broken.
  3. #if Int(msvc_runtime_major_version,14) >= 14
  4. Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_Win32.msi"" /L*v ""{tmp}\vccrt{#msvc_runtime_library_version}_Win32.log"" "; StatusMsg: "Installing MSVC 32-bit runtime libraries to system directory"; Check: HasWI30; Components: ClientComponent;
  5. #if PlatformTarget == "x64"
  6. Filename: msiexec.exe; Parameters: "/qn /norestart /i ""{tmp}\vccrt{#msvc_runtime_library_version}_x64.msi"" /L*v ""{tmp}\vccrt{#msvc_runtime_library_version}_x64.log"" ";  StatusMsg: "Installing MSVC 64-bit runtime libraries to system directory"; Check: HasWI30; Components: ClientComponent;
  7. #endif
  8. #endif
https://github.com/FirebirdSQL/firebird/blob/master/builds/install/arch-specific/win32/FirebirdInstall.iss

I'm not sure how to use C/C++ runtimes without installing them.

zoltanleo

  • Hero Member
  • *****
  • Posts: 522
Re: Firebird 5 client without install
« Reply #5 on: April 03, 2024, 07:57:09 pm »
Hi everyone. My client application does not reside on the server. If I also install Firebird on the client it works, but if I only copy fbclient.dll to windows\system32 or in any case in the path it doesn't work. What is the minimum set of files to include so as not to have to install firebird on the client too? I couldn't find anything on the documentation.
Hi calm_sea

You don't have to copy some files. You can unzip the zip archive into some folder. Then run the server as an application with a free port. And you can specify this port in the connection string. E.g.

Code: Bash  [Select][+][-]
  1. $\: c:\fb5\bin\firebird.exe -a -p 12345
...
Connection string: 127.0.0.1/12345:<your_database-path>

This will allow the server to work in full mode without the need to install the server in the system
Win10 LTSC x64/LMDE7-x11-x86_64(gtk2/gtk3)/Fedora-44-wayland-x86_64(gtk2/gtk3)/ Kubuntu-24-x11-x86_64(qt5/qt6)/KDE Neon-wayland-x86_64(qt5/qt6)/Darwin Cocoa x86_64 (15.7.7):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 5.0.3 x86_64; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

rvk

  • Hero Member
  • *****
  • Posts: 7045
Re: Firebird 5 client without install
« Reply #6 on: April 03, 2024, 08:05:36 pm »
You don't have to copy some files. You can unzip the zip archive into some folder. Then run the server as an application with a free port. And you can specify this port in the connection string.
The problem is that those DLL files from Firebird need the C/C++ runtime from Microsoft. These are often already installed by other software but on a clean fresh Windows system they are not installed and in that case the Firebird DLLs only work after installing that C/C++ runtime.

zoltanleo

  • Hero Member
  • *****
  • Posts: 522
Re: Firebird 5 client without install
« Reply #7 on: April 03, 2024, 08:20:18 pm »
The problem is that those DLL files from Firebird need the C/C++ runtime from Microsoft. These are often already installed by other software but on a clean fresh Windows system they are not installed and in that case the Firebird DLLs only work after installing that C/C++ runtime.
I agree. There are features here, starting with Fb4.
Win10 LTSC x64/LMDE7-x11-x86_64(gtk2/gtk3)/Fedora-44-wayland-x86_64(gtk2/gtk3)/ Kubuntu-24-x11-x86_64(qt5/qt6)/KDE Neon-wayland-x86_64(qt5/qt6)/Darwin Cocoa x86_64 (15.7.7):
Lazarus x32_64 (trunk); FPC(trunk), FireBird 5.0.3 x86_64; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

regs

  • Jr. Member
  • **
  • Posts: 99
Re: Firebird 5 client without install
« Reply #8 on: August 07, 2025, 06:27:15 pm »
The problem is that those DLL files from Firebird need the C/C++ runtime from Microsoft. These are often already installed by other software but on a clean fresh Windows system they are not installed and in that case the Firebird DLLs only work after installing that C/C++ runtime.
SQLite also requires MSVC.
SQLite also requires ICU to support more than just ASCII. Although those are internationalized forks, like SQLite3MC. Official SQLite library only support ASCII and doesn't support anything outside basic Latin.

So this is not the problem. The problem is in everything else - dozens of additional files, like conf, msg, plugins, intls. Older embedded was just a single dll file.

regs

  • Jr. Member
  • **
  • Posts: 99
Re: Firebird 5 client without install
« Reply #9 on: August 07, 2025, 07:05:44 pm »
You might be right. But ICU requires MSVCP. And SQLite is pratically unusable without it. Firebird come pre-bundled with ICU and requires same version of runtime as ICU.
« Last Edit: August 07, 2025, 07:18:36 pm by regs »

 

TinyPortal © 2005-2018