Closed Daandelange closed 1 year ago
Yes, what's happening is normal, i'll explain:
in OSX ( and only there ) the MosaicRepo/bin/data/
folder content is the reference of what needs to be copied inside the bundle after compiling ( manually, and just for the first time, as newer compiles on the same path will maintain the bundle content ). It is working like that because until now, most of the time users in OSX just download the release and run it, so no issues with that, but yes, you're right, this need some kind of automation, i'll write a script to run after ( or before ) compile to automatically copy everything inside the bundle, so this scenario will disappear.
But yes, the idea of implementing a datafolder-available-check it's a good one, so let me know when you have it, and thanks for the suggestion!
This is the Mosaic bundle content ( for reference )
:
with data/
content copied inside Resources/
folder and examples/
and plugins/
folders copied as it is.
sorry for the delay, i was AFK
Ok, thanks for your clarification.
I think the Release should be as easy to run as a binary compiled from source (except it takes longer); so yes, please make this scenario disappear 😇 .
https://github.com/d3cod3/Mosaic/tree/fix-dataFolder-issue-46
I got something here for checking the data folder and added some log messages to them. (Note: I also re-arranged some conditions to prevent duplicate code.)
There's even a fallback for grabbing it from the CompiledBinary/../data
folder (which exists if ran from a MosaicRepos), but it looks at binary/../data
so this might be insecure if the ReleaseBinary/../data
exists in some rare cases. (possible solution: only include that part in debug builds, or strip it out)
I'm looking into this, it has never been fixed and it really bothers me on every version increment. Is there something like a "release" or "git" compile flag in Mosaic ? (not debug/release)
That fixes them on OSX :)
Closing this as it's been merged. :)
After updating Mosaic from master,
ofApp::initDataFolderFromBundle()
tries to replace the data folder (~/Documents/Mosaic/data
) with a brand new corresponding to the release folder. On my setup, the automatic copy command fails.Manually copying
MosaicRepo/bin/data
to~/Documents/Mosaic/data
works, but I'd like the automatic alternative to work.Here's my diagnostic :
Here,
dataDir = MosaicRepo/bin/Mosaic_debug.app/Contents/Resources/
andmosaicPath = ~/Documents/Mosaic/data
.dataDir
doesn't exist which causes the copy command to do nothing.Later, this condition keeps being false, as the relFile (
~/Documents/Mosaic/data/release.txt
) doesn't exist (thedata
folder is empty); causing the data folder never to be created.Shouldn't
dataDir
hold something likeMosaicRepo/bin/Mosaic_debug.app/Contents/Resources/../../../data
?Or should the
Resources
folder exist ?I'd also like to implement a datafolder-available-check to prevent Mosaic from running (=crashing later) within
initDataFolderFromBundle()
. Good idea ?