Shipping an app with oracle instant client.

I am connecting to an Oracle database from within my Xojo app.

However prior to being able to connect I had to download a zip file:

Then I used followed these instructions to install the instant client

unzip cd ~/instantclient_11_2 ln -s libclntsh.dylib.11.1 libclntsh.dylib ln -s libocci.dylib.11.1 libocci.dylib mkdir ~/lib ln -s ~/instantclient_11_2/{libclntsh.dylib.11.1,libnnz11.dylib,libociei.dylib} ~/lib/

Within my code I needed to add this line:

 System.EnvironmentVariable("DYLD_LIBRARY_PATH") = "/Users/bob/instantclient_11_2"

These instructions aren’t very hard, but I’m not sure how I’m ever going to get this to work in the field.
I didn’t quite understand why I needed to make the ~/lib directory and soft links to the dylibs there.

Any suggestions on how to package instant client with my application such that it works?

System.EnvironmentVariable(“DYLD_LIBRARY_PATH”) = “~/instantclient_11_2”
work ?
if so you can make life a little easier

the script just unpacks instant client into a subdir the users home directory and then sets the dyld path to ONLY that path (this may cause problems as you usually add to the dyld path rather than replace it)

you could at launch of you app detect if things have already been unzipped & if not do that step and the set up the library path using a shell. juts include the zip so you can use a shell to tell which file to unzip & include the zip in your app bundle resources

that way even if a user nukes it your app will detect that and put things back in place

I would suggest trying to unpack this into the Application Support dir for your app though

Nope ~ doesn’t work.
and unless i have the ~/lib directory it also doesn’t work.

Sucks because then you have to figure out this path for every user

    System.EnvironmentVariable("DYLD_LIBRARY_PATH") = "/Users/bob/instantclient_11_2"

since it’s in their home directory

but the rest should still work

Have you tried unpacking it to app support instead of the users home dir ?

I haven’t tried that Norman… I will however try it and let you know.
Cheers and Thanks, Merci, Gracias, Danka, Cam-On, Kahmsamhamnida, xie xie, spaciba, do-che etc etc etc :wink:

Not sure if you got this resolved, but I am using Instant Client for other tools and I had to do the following:

Create a new environment variable TNS_ADMIN, with the value set to the Oracle Instant Client directory

TNS_ADMIN = c:\instantclient_12_1