Deploying InterBase 2017 ToGo on Mac OS X

Posted by on in Blogs

InterBase 2017 ToGo Edition is a full-featured, multi-device embeddable database for Windows, Linux and macOS that runs in a stand-alone environment but allows deployment of applications which directly utilize the InterBase engine DLLs. With no separate database server process running, the database engine executes in the application process space providing an extremely small footprint. Together with other key features such as high security, zero administration, and simple installation, InterBase 2017 ToGo is an incredible solution for VARs, OEMs and ISVs

The InterBase ToGo database engine can be embedded in your Mac OS X applications by directly using the InterBase database engine library. InterBase ToGo does not have to be installed on any server or end-user workstation and it does not require that InterBase is installed on a machine before use like InterBase Server and InterBase Desktop.  InterBase ToGo is also available on Apple MAC OS X.

This post describes, using RAD Studio (Delphi and/or C++ Builder) how to create and deploy an InterBase ToGo application to Apple Mac OS X.

Note:  if you are developing with RAD Studio, the process to deliver the InterBase ToGo license with a packaged application is the same for Mac OS X as it is for the Mobile OS (iOS and Android). So, the InterBase ToGo license activation file, reg_*.txt, should be delivered in the "redist" location where RAD Studio picks up the InterBase license. Be sure to make sure the file name reg_*.txt matches the one listed in the "Deployment" file list when RAD Studio packages the application for Mac OS X.

 Part 1 - Install InterBase 2017 ToGo

On Windows, in you RAD Studio IDE, you can use the GetIt Package Manager (Tools | GetIt Package Manager) to install InterBase 2017 ToGo:

 IBTo2017GetIt

The InterBase 2017 ToGo installation installs your redistributable files in the folder C:\Users\Public\Documents\Embarcadero\Interbase\redist\InterBase2017

And your RAD Studio IDE, your IBREDISTDIR Environment Variable (Tools | Options | Environment Options | Environment Variables) should now be set to your InterBase 2017 ToGo redistributable folder:

IBREDISTDIR

For the Mac OS X, you have the Mac OS X folder C:\Users\Public\Documents\Embarcadero\Interbase\redist\InterBase2017\osx32_togo with the InterBase 2017 ToGo .dylib (dynamic library extension on OS X) files that need to be deployed to the Mac with your Mac OS X InterBase 2017 ToGo application:

libibtogo_dylib

 Part 2 - InterBase 2017 ToGo Serial Number

 

If you don't have your own InterBase ToGo Serial Number, you can get a free 30-day license for InterBase 2017 ToGo for Windows and Mac from here:  https://www.embarcadero.com/products/interbase-togo/start-for-free

InterBaseTrial

Enter your Embarcadero Developer Network (EDN) Username and Password, and you will get emailed your Serial Number for your InterBase 2017 ToGo Edition Deployment 30 Days Trial.  The email looks like this:

InterBase_SN_email

 

Part 3 - InterBase 2017 ToGo Activation File

The InterBase 2017 ToGo Edition needs to be registered using your InterBase ToGo Serial Number as described here:  http://docwiki.embarcadero.com/InterBase/2017/en/Installation,_Registration,_and_Licensing_Information#InterBase_ToGo_Edition

To activate your InterBase 2017 ToGo Trial license, please go to https://reg.embarcadero.com/srs6/activation.do and enter your InterBase ToGo Trial Deployment Serial Number. Enter the Registration Code: 737479

InterBaseProductReg

Click Next:

DownloadActivationFile

Select Download and Click Register.

After you activate your “ToGo” license, you will get an activation file like this:

reg1567_0152775697010.txt

This is your InterBase 2017 ToGo license file that you will need to deploy with your InterBase 2017 ToGo application on the Mac OSX.

Note:  As you will see, when using the RAD Studio Deployment Manager, if you are Sand-Boxing your Mac OS X application, the license file gets deployed to your Contents\Resources\StartUp\interbase\license\ folder on the Mac.

Part 4 - Create your Multi-Device Database application using InterBase 2017 ToGo

Embarcadero has several tutorials on how to create multi-device applications using FireDAC such as these:

Tutorial: Using FireDAC from a Multi-Device Application on Desktop Platforms

Mobile Tutorial: Using InterBase ToGo with FireDAC (iOS and Android)

For this example, I'll use the Mobile Tutorial: Using InterBase ToGo with FireDAC (iOS and Android) and show deploying the application to Mac OS X using InterBase 2017 To Go.

Follow the tutorial up to the section Deploying your Application to Mobile.  At that point, your Multi-Device application should look like this in your RAD Studio IDE:

DelphiIBToGoMAC

Instead of deploying to Mobile (iOS and Android), we will follow the instructions in the next Part 5 - Deploying your Application to OS X to deploy our InterBase 2017 ToGo application to our Mac.

Part 5 - Deploying your Application to OS X

Up to this point, we have used InterBase ToGo on our desktop. This means that the actual database is located at your local hard disk drive (for example, C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\19.0\\Samples\\Data\\dbdemos.gdb). To deploy the application on OS X, you need to copy the database file to the Mac OS file system (for example, /Users/<user>/dbdemos.gdb). Also, the Interbase ToGo files must be deployed to OS X.

Deploy Interbase ToGo to OS X

  1. Open the Deployment Manager by selecting Project > Deployment.
  2. Select All-Configurations - OS X platform from the drop-down list of target platforms at the top of the Deployment Manager.
  3. Select Add Featured Files (DMgrAddFeatFiles.png):

AddingFeaturedFiles

4. Select the Interbase ToGo database module for OSX.  Uncheck the reg_ibtogo.txt and the reg_iblite.txt and then click OK to close the Featured Files dialog box:

AddfeaturedOSX

5. Using the Deployment Manager , click the Add Files icon, and manually add our InterBase 2017 ToGo Activation file reg1567_0152775697010.txt that we obtained from Part 3 above.

6. Using the Deployment Manager, click the Add Files icon, and manually add our InterBase dbdemos.gdb file.

7. Verify the Deployment Manager shows your dbdemos.gdb, your license activation file reg1567_0152775697010.txt, and the Mac OS X libibtogo.dylib files will be deployed to your Mac:

DeploymentManagerIBToGo

The Deployment Manager should correctly set the Remote Path on the Mac for all of the needed files to be deployed to the Mac.

 

Part 6 - Modify your RAD Studio code to connect to your InterBase ToGo Database on Mac OS X

Your TFDConnection component is connected to the InterBase dbdemos.gdb database on Windows. So we need to replace the location of the file before connecting to the database, as follows:

 

  1. In the Form Designer, select the FDConnection1 component.
  2. In the Object Inspector, double-click the Value field of the BeforeConnect event.
  3. Add the following code to this event handler:

procedure TForm3.FDConnection1BeforeConnect(Sender: TObject);

begin

{$IFDEF MACOS}

  FDConnection1.Params.Values['Database']:= '$(DOC)/dbdemos.gdb';

{$ENDIF}

end;

Note that $(DOC) is a path variable, allowing you to simplify the writing of path expressions. On Mac OS X, the $(DOC) points to the user home directory (/Users/<user>/Documents). So your dbdemos.gds needs to be deployed to folder:   "/Users/amannarino/Documents/dbdemos.gdb"

With your PAServer, the Platform Assistant Server Application running on you MAC, select the OSX Target Platform in your RAD Studio IDE:

OSXIBToGoTarget

Run your Application, and on your Mac, you should see your InterBase 2017 ToGo Application running like this:

IB_2017_ToGo_Mac_OSX

 

Congratulations!

 



About
Gold User, Rank: 90, Points: 4
Al Mannarino has 25+ years of software development experience, including object-oriented analysis and design (OOAD) and developing and deploying production applications. He is currently a Principal Software Consultant and Evangelist for Embarcadero Technologies. Prior to joining Embarcadero, Al spent three years working with CodeGear, a division of Borland that was acquired by Embarcadero in 2008. He also worked for five years as a lead systems engineer for Borland supporting application lifecycle management, software delivery optimization and developer tools solutions. Prior to Borland, Al served as a systems engineer for companies including Objectivity, Versant, Red Brick Systems, Information Builders, and was an electrical engineer for Grumman Aerospace performing application implementations on complex electrical-mechanical systems. Al has a bachelor's of science degree in electrical engineering from Manhattan College.

Comments

Check out more tips and tricks in this development video: