Differences between compiled and wrapper

I completed my program for OSX and put some folders and files within the “contents” folder of the compiled.
Everything works, the program starts, it read and write the files in “contents” folder… everything ok.

As soon as I process the compiled with Wrapper the program is no longer able to write in the “contents” folder.
I checked that the .app after wrapper is equal to before wrapper.

Why I can’t write in “contents” folder after Wrapper?

If you mean App Wrapper, then it is quite normal. Sandboxed apps cannot write within the bundle.

It is bad form anyway to write within the bundle. What you should do is in the app open copy your files from the bundle to a folder you create in SpecialFolder.ApplicationData. The folder should called like your app ID, for instance com.mycompany.mygreatapp.

There you will be able to write to the files even when the app is sandboxed.

NEVER write back to your “contents”.
Most OS X versions will block this.
And what happens if someone downloads your app & uses it from a DMG ?

You should use SpecialFodler.ApplicationData with a directory in there that is for your application
Create it any time you find that this directory is missing and copy all the things you need from contents into this and use the SpecialFolder location by default

Worst: when time come to place the data you wrote in Contents to, say, an archival location, you will end with alias files, not the real files (because your application is in the OS X Applications folder).

And, if you delete these files before checking what you copied… you lost your files.

Fortunately, you come and ask a question in this forum.

My first way was wrong.
I’ll write on Special Folder in SharedPreferences, creating a myApplication Folder and write all in it.
Thank you all.

To be sure: you wrote your application preferences in the SharedPreferences folder ?

yes, I think to write there. Why?
I can’t create a subfolder and write all there?
I thinking SharedPreferences because is for all user.

SharedPreferences is not readily available trhough regular Xojo calls.

Especially since a Sandboxed app does not have access to the regular folders as default.

Use ApplicationData, and you will be fine.

But ApplicationData is for each user, right?
I need to save the images in a folder, but all user have to read these images.
What folder I can use to shared the images by all users?

Sandboxed apps are meant to be single users.

Maybe Sam Rowlands has a solution for what you want to do. It probably requires a temporary entitlement, and it is not sure this will pass Apple MAS reviewers.