Use of App.ExecutableFile ?


I tried App.ExecutableFile (OS X) recently and did not understand its use. Can you enlight me ?

App.ExecutableFile on OS X returns

It is simply the path to the application program within the bundle :slight_smile:

You can use App.ExecutableFile.Parent.Parent.Child(“Resources”) to find the Resources folder, for example.

The question was: wat use I have for this path ?

That was how I use it, but… it is of no use !

As far as I know, we will not place data there. A better location is awaited.

Why ask the question ? You are the only one who can answer that. Depends what you want to access in the bundle. If you need to access anything there.

For me, I use it as app.executablefile.parent.parent.child("Resources").child("") to locate a file I have dragged into the project and copy it somewhere else or open it with a shell. Unzip it for instance in this case.

We place data there to create a self-contained executable, and copy the data to SpecialFolder.ApplicationData upon first run. This is a very common use.

Be aware that the ONLY data that should be in that RESOURCES folder is data (docs, graphics etc) that are dragged into the IDE BEFORE compile time… DO NOT attempt to save files to, or alter files in this location…

Also this location does not exist for Windows, as it stores it resources in a totally different manner (dictated by Windows, not by XOJO)

I store SQLite databases and sounds in the Resources folder for Mac, Win and Lin using CopyFile. On Open, I copy them (if they don’t exist outside) to an external folder where I can manipulate them without sandboxing restrictions. This is unnecessary for Windows and Linux, but I do it the same. It means I can submit the one app to the Apple MAS.