Defining the Installation Component

From InterBase

Go Up to Installing

TIBInstall provides the following properties for defining an installation component:

TIBInstall properties
Property Purpose

DestinationDirectory

Sets or returns the installation target path; if not set, defaults to what is in the Windows registry.

InstallOptions

Sets what InterBase components are to be installed; see below.

MsgFilePath

Sets or returns the directory path where the ibinstall.msg file can be found.

Progress

Returns an integer from 0 to 100 indicating the percentage of installation completed; if unset, no progress is displayed.

RebootToComplete

If set to <True>, returns a message instructing the user to reboot after installation is complete.

SourceDirectory

Sets or returns the path of the installation source files; in most cases, this will be a path on the InterBase CD.

UnInstallFile

Returns the name and path of the uninstall file, which contains information on the installed options.


Setting the Installation Options

The InstallOptions property allows you to set which InterBase components are to be installed. Set any of the following options to <True> to install it. For more information on each option, refer to the online help for TInstallOptions.

TIBInstall options
Option Installs:

CmdLineTools

the InterBase command line tools, including isql, gbak, and gsec.

ConnectivityClients

the InterBase connectivity clients, including ODBC, OLE DB, and JDBC.

Examples

the InterBase database and API examples.

MainComponents

the main InterBase components, including the client, server, documentation, GUI tools, and development tools.

TIBInstall keeps track of the installed options in the uninstall file.

The following code snippet shows how you could set up a series of check boxes to allow a user to select the InterBase main components:

procedure TSampleform.ExecuteClick(Sender: TObject);
var
MComps : TMainOptions;
begin
Execute.Visible := False;
Cancel.Visible := True;
MComps := [];
if ServerCheck.Checked then
Include(MComps, moServer);
if ClientCheck.Checked then
Include(MComps, moClient);
if ConServerCheck.Checked then
Include(MComps, moConServer);
if GuiToolsCheck.Checked then
Include(MComps, moGuiTools);
if DevCheck.Checked then
Include(MComps, moDevelopment);
if DocCheck.Checked then
Include(MComps, moDocumentation);
IBInstall1.InstallOptions.MainComponents := MComps;


Setting Up the Source and Destination Directories

Use the SourceDirectory, DestinationDirectory and SuggestedDestination properties along with the InstallCheck method to set up the source and destination directories for your installation component. The following code snippet uses two TDirectoryListBox components, SrcDir and DestDir, to allow the user to change the source and destination directories. The InstallCheck method checks to see if everything is prepared for the installation.

try
IBInstall1.SourceDirectory := SrcDir.Directory;
IBInstall1.DestinationDirectory := DestDir.Directory;
IBInstall1.InstallCheck;
except
on E:EIBInstallError do
begin
Label1.Caption := '';
Cancel.Visible := False;
Execute.Visible := True;
ProgressBar1.Visible := False;
Exit;
end;
end;


Setting Up the Installation Progress Components

Use the Progress property, along with a ProgressBar component track the installation status.

function TSampleform.IBInstall1StatusChange(
Sender: TObject; StatusComment : String): TStatusResult;
begin
Result := srContinue;
ProgressBar1.Position := IBInstall1.Progress;
Label1.Caption := StatusComment;
if Cancelling then
begin
if Application.MessageBox(PChar('UserAbort'),
PChar('Do you want to exit'), MB_YESNO ) = IDYES then
Result := srAbort;
end
else
// Update billboards and other stuff as necessary
Application.ProcessMessages;
end;


Advance To: