OK, I have searched all over trying to figure this out…
On WInodows I know the resource folder is directly under the application directory called resources
On Mac it appears inside the application package under Contents/Resources, but I sure can not access it the same way it seems.
I use this as the code for file access to files in the resources dir Xojo.IO.SpecialFolder.GetResource(“myfile.ext”)
I can create, copy etc a file under the Xojo Windows app at any time and access it, under Mac it never sees any file that I place there after building. I am looking for a place to download some extras after the Xojo application has been installed and wanted under the resources directory so I have a few questions,
1: Do Xojo Mac apps use the Resources dIrectory inside the App package under Contents/Resources or does it create a directory somewhere else for the application
2: If it does use the Resources folder inside the application package, does it hardcode the list of available files at build time in the resource directory and therefore will ignore any additional files inside the folder? I cannot use build steps for this because some of these files will be downloaded over time
I could use the application data directory, ie
SpecialFolder.ApplicationData.Child(mAppName)
To store these I guess, but I want to know how this resources folder works for future issues I may run into.
Mac “apps” are not a compiled “.exe” like windows is…
in reality an “APP” is a “bundle” (a special folder structure).
I don’t recall the exact structure off the top of my head from Xojo point of view…
but it was something like
app.executablefile.parent.parent.resources(“the file you want”)
oh… and don’t be confused… the “executable” part IS compiled on Mac… just not the same structure…
but depending on what you are putting there, and how you want to retrieve it… usually just use the “name” of the file as shown in the Project Navigator
[quote=331426:@Tony Chamberlain]I can create, copy etc a file under the Xojo Windows app at any time and access it, under Mac it never sees any file that I place there after building. I am looking for a place to download some extras after the Xojo application has been installed and wanted under the resources directory so I have a few questions,
[/quote]
You cannot and should not try to place items in the “Resources” dir in a Mac app
This may require special privileges to do so
Or the app may be on a non-writeable volume (CD, DMG etc)
yes
[quote=331426:@Tony Chamberlain]or does it create a directory somewhere else for the application
[/quote]
No
[quote=331426:@Tony Chamberlain]2: If it does use the Resources folder inside the application package, does it hardcode the list of available files at build time in the resource directory and therefore will ignore any additional files inside the folder? I cannot use build steps for this because some of these files will be downloaded over time
[/quote]
No - but as I said above you should not try to copy files in to here (ever) as the app may be running from a non-writable volume etc