• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

delphi and interbase

Dear experts

  is there any way to make an installar for my application that installs my softwar + interbase so the user do not need to install interbase then the software separetly

Thank you
0
omarmf
Asked:
omarmf
  • 2
3 Solutions
 
mikelittlewoodCommented:
Are you using the borland install express that comes with Delphi.

There should be an optioin to build the application with the inclusion of any interbase files that need to be installed on client PC's along with your program.
0
 
esoftbgCommented:
You may create a Setup application, which to check about the InterBase (and FireBird) is installed and should install it if it is not. Then Setup will check about your application and it is not installed it should install it ....
The answer is yes, there is a way to do it.
0
 
TheRealLokiSenior DeveloperCommented:
Wise Solutions has an install program which can bundle the interbase client
several others, such as InstallShield which used to be avbailable with Delphi in the earlier days on the cd
Try InnoSetup if youwant a "free" option. I am unsure if it supports interbase though

btw, the interbase client is simply installing the gds32.dll into windows\system32
and you might need to add the line
gds_db           3050/tcp
to your windows\system32\drivers\etc\services file
0
 
esoftbgCommented:
unit Unit1_Q_21334438;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Registry, IdGlobal, ShellAPI, ComCtrls;

type
  TForm1 = class(TForm)
      spb_Install: TSpeedButton;
      Edit_Target: TEdit;
      Edit_Result: TEdit;
      spb_FireBird: TSpeedButton;
      Memo: TMemo;
      rbt_Overwrite: TRadioButton;
      chbx_Details: TCheckBox;
      ProgressBar: TProgressBar;
      procedure FormCreate(Sender: TObject);
      function  InstallApp: Boolean;
      procedure spb_InstallClick(Sender: TObject);
      procedure spb_FireBirdClick(Sender: TObject);
      procedure chbx_DetailsClick(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function  CheckAboutFireBird: Boolean;
var
  S:      string;
  Reg:    TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    Reg.LazyWrite := False;
    Reg.OpenKey('SOFTWARE\Firebird Project\Firebird Server\Instances', False);
    S := Reg.ReadString('DefaultInstance');
  finally
    Result := DirectoryExists(S);
    Reg.CloseKey;
    Reg.Free;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  if not CheckAboutFireBird then
  begin
    ShellExecute(handle, 'open', PChar('Firebird-1.5.2.4731-Win32.exe'), '', '', SW_SHOWNORMAL);
  end;
end;

function  TForm1.InstallApp: Boolean;
var
  Bexe:   Boolean;
  Bgdb:   Boolean;
  SPath:  string;
  SFile:  string;
  TPath:  string;
  TFile:  string;
begin
  Bexe := True;
  Bgdb := True;
  try
    Memo.Clear;
    ProgressBar.Position := 0;
    SPath := ExtractFilePath(Application.ExeName);
    SFile := SPath + 'App.exe';
    TPath := Edit_Target.Text;
    while (TPath[Length(TPath)]='\') do
      Delete(TPath, Length(TPath), 1);
    ForceDirectories(TPath);
    TFile := TPath + '\App.exe';
    if not FileExists(TFile) then
      Memo.Lines.Add('App.exe is not installed ')
    else
    begin
      Memo.Lines.Add('App.exe is already installed ');
      if (DeleteFIle(TFile)) then
        Memo.Lines.Add('App.exe is deleted ');
    end;
    if not FileExists(TFile) or rbt_Overwrite.Checked then
    begin
      Bexe := CopyFileTo(SFile, TFile);
      case Bexe of
        True: Memo.Lines.Add('Installation of App.exe is successfull');
        else  Memo.Lines.Add('Installation of App.exe is not successfull');
      end;
    end;
    ProgressBar.Position := (ProgressBar.Max div 2);
    SFile := SPath + 'MTV.GDB';
    TFile := TPath + '\MTV.GDB';
    if FileExists(TFile) then
      Memo.Lines.Add('MTV.GDB already exists')
    else
    begin
      Memo.Lines.Add(TFile);
      Bgdb := CopyFileTo(SFile, TFile);
      case Bgdb of
        True: Memo.Lines.Add('Installation of MTV.GDB is successfull');
        else  Memo.Lines.Add('Installation of MTV.GDB is not successfull');
      end;
    end;
  finally
    Result := Bexe and Bgdb;
    ProgressBar.Position := ProgressBar.Max;
  end;
end;

procedure TForm1.spb_InstallClick(Sender: TObject);
var
  S:      string;
begin
  if not CheckAboutFireBird then
  begin
    S := 'Firebird is not Installed. Please install it first.';
  end
  else
  begin
    case InstallApp of
      True: S := 'Installation of App.exe is successfull';
      else  S := 'Installation of App.exe is not successfull';
    end;
    Edit_Result.Text := S;
  end;
end;

procedure TForm1.spb_FireBirdClick(Sender: TObject);
begin
  ShellExecute(handle, 'open', PChar('Firebird-1.5.2.4731-Win32.exe'), '', '', SW_SHOWNORMAL);
end;

procedure TForm1.chbx_DetailsClick(Sender: TObject);
begin
  case chbx_Details.Checked of
    True: Height := 256;
    else  Height := 128;
  end;
end;

end.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now