My project was started over 15 years ago in REALbasic by a consultant, and he did not use a Resources folder. Perhaps that early IDE didn't use one. Anyway, my app is now having a problem finding its data folders on some Macs when the parent folder and its contents have been zipped and expanded.
I am currently using Xojo 2016r4.1. Everything is in the parent folder OpVP. It contains, along with other data files, OptimumVP.app and a folder "RequiredFiles" containing several text files. My code looks for that folder as follows:
dim f as FolderItem
f = GetFolderItem( "RequiredFiles" )
if not f.directory then ...[error code]
This works fine except on some Mac systems (especially Mojave) when the parent folder and its contents have been zipped (to be sent by email) and expanded. In that case, f.directory is nil.
- Should I create a Resources folder?
- Should it be next to the app in the OpVP folder?
- Should all the data files be in the Resources folder?
- Is there anything (other than the app) that should not be in the Resources folder?
- What should the code be to locate a folder within the Resources folder?
- What should the code be to open a data file within that folder?
- Is all this the same for both Windows and Mac?