Official way to attach files to the project

Hello
I’m working on a Desktop App (Win, Mac, Linux) and I need to attach some text files like settings and JSon files. Am I right using the GUI item “Folder” for this? I’ve seen it adds the file to build, sadly with different folder names. So I would then have to differ where to read the files (in relation of executable):
Mac: …/Resources
Windows: AppName/Resources (appname upper/lowercase)
Linux: appname/Resources (appname lowercase)

Furthermore it seems I’m not allowed to create a directory structure inside a GUI item “Folder” by adding another GUI item “Folder” in the main item “Folder”: All files in any subfolders are moved to the main folder and all subfolder directories are removed. Weird…

All over: Should I use the GUI item “Folder” for attaching configuration files that will be read/used by the application?

https://documentation.xojo.com/api/files/specialfolder.html

Read: ApplicationData

Store there what your application need and then read from there.

Excellent, thank you! Explains also the differences of each OS.

@Emile Schwarz : I was a bit too quick with “right answer”. Your answer explains where I should store data OS wise. That’s also good to know and i will use that. But on BUILIDNG my application what is the best/wanted way to attach existing files to it? I have a JSON file that I would release with the build and then read it by the application itself.

Okay, I guess to use the GUI “Folder” item for this is adequate. Your link also offers “SpecialFolder.Resource” that directs to the folder where the to “Folder” attached files are stored.

And from there, at run time, your application will copy these files to the Application Data folder. Look Xojo local Language Reference (easy to look on macOS)…

Ah, now I got the point! Will look that up, tnx!

as i understood you need a sub folder in ApplicationData.
i don’t know how to prevent that other apps maybe create the same folder there.

Subfolder: nice to have, just for more clear structure. Yeah, if needed I could/would create the folder structure at runtime

Initially I wanted to know HOW (or by which GUI element) I can ATTACH files to the application, so they are “part” of the app. With the GUI item “Folder” it works fine.

To make files part of the app, you can simply drag files into the project, in the left hand side column.

You can also use a Build Step in the Insert menu, Copy Files, to copy files to the Resources folder.

When the app is built, the files will be in the Resources folder in Windows. In Mac, they will be part of the .app bundle.

Look there (in the Application Data folderà) how the folders are built: most of the time as, for examples:

Xojo
com.operasoftware.Opera
LibreOffice

and so on.

So unless your application name or web site (inverted) already collide (is the same) with another one, this is not possible to be in trouble there (hopefully).

BTW: when in doubt, I look how things are done (in macOS or/and WIndows), then I made my mind and I do accordingly (if/when possible).

Nota: you certainly remember one day Digital Photo (not only ?) makes eyes red. One stupid guy one day released an application that removed the red from the eyes as Redeye (name of a comic strip owned by KFS (King Features Syndicate) who also owns Mandrake (rings a bell too ? Hint: Linux…).