What happens to Specialfolder.Applicationdata when app deleted

Hi Xojo gurus

I have a simple accounting app called QuickBAS.
I have a free trial version downloadable from my website (installs as a pkg file), and a full paid version downloadable from the Mac App Store.
The 2 versions have the same app name: QuickBAS.app
The app stores data in a single sqlite database in SpecialFolder.ApplicationData.appname

In OS X 10.9 and before, SpecialFolder.ApplicationData was located in /Users/UserName/Library/ApplicationSuport/appname

In OS X 10.10 it is located in /Users/UserName/Library/Containers/BundleID/Data/Library/ApplicationSupport/appname

2 Questions:

  1. (?easy) If a user upgrades their OS from 10.9 to 10.10, does their data location automatically get upgraded to the new location? i.e. they do not lose their data?

  2. (?harder) If a user installs the free trial version (not MAS), and creates data, then downloads and overwrites with the full version of the app from the MAS, does the database remain intact in the ApplicationSupport.child folder? What if they delete the trial version first? Does the database get deleted with the app?

I have done a limited trial on my own Mac, and the database seems to stay in place when app is overwritten or deleted but I want to be sure, as the data is financially critical and my customers will be mighty pissed if the data is lost with during an upgrade of app.

Many thanks

If the free trial creates data in application support, then the traditional method of ‘uninstalling’ (i.e. dragging the app to the trash) doesn’t delete the data from Application Support.
So on most macs there is a pile of orphaned data and settings hidden away in this folder taking up space that is difficult to free up without a full re-install.

Since a sandboxed app uses a different location for this stuff, I don’t know whether the MAS app will be able to detect the presence of data created using the free trial. (maybe you need a ‘browse for data created using free trial’ option?)

And although I know that deleting an app from iOS also deletes the allocated document storage, I don’t know if a similar mechanism exists under OSX. Your tests suggest that OSX doesn’t have a trigger that deletes storage along with an MAS app.

Clarification:
ApplicationData folder location varies according to non-sandboxed vs sandboxed app, not by OS version (thanks Jeff)

Yes, if I simply drag app to trash, the ApplicationData folder remains.

My full version M.A.S app does look for a database, and only creates a new one of there isn’t one already there.

Will installing a paid M.A.S app overwrite an existing (trial) app as long as they have the same name? And use the same ApplicationData folder? Both are sandboxed.

[quote=147914:@Rob Lang]Clarification:
ApplicationData folder location varies according to non-sandboxed vs sandboxed app, not by OS version (thanks Jeff)

Yes, if I simply drag app to trash, the ApplicationData folder remains.

My full version M.A.S app does look for a database, and only creates a new one of there isn’t one already there.

Will installing a paid M.A.S app overwrite an existing (trial) app as long as they have the same name? And use the same ApplicationData folder? Both are sandboxed.[/quote]

If both are sandboxed and have the same application identifier, they will access the same Application folder. So you can either reuse the database, or erase it. It’s up to you. If the application identifier is different, you will not be able to access the evaluation version folder.

many thanks to you both.