Strange problem sharing a JUCE osx app


Hi all,

The problem is probably not directly with JUCE (but may be there’s some xcode project setting required).

I prepare an app with JUCE (hearing testing). It works fine on my computer (macbook pro with osx sierra). The app plays some wav sound files. It loads the files with (maybe this is not the optimal way) :
File file (File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile(soundfilename ).getFullPathName());

The files sound files are in the app folder. Everythings works fine on my computer.

Then,I make a zip archive with my app folder and send it by email to a friend who also have an osX sierra laptop. He unzip the folder. If he try to open the application the interface loads and the app seems to run without a problem but no sound is played ! and also no results of testing are written in the result file (a txt file in the app folder). But no crash… just no sound…

If now my friend get the zip archive via network sharing (connect to my computer to take the zip file) instead of getting from an attached file in email… He unzip the archive and now the app works perfectly (with sound) !

(it is the same zip file in both case)…

if now, I put the zip file on a web site and he download the file from there via web browser… unzip it … and… no sound…

I put a txt label in my interface to display the path of the file it tries to access (i.e. the result of File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile(soundfilename ).getFullPathName())

when sending by email/web… it tries to play the sound from a subfolder of /private/var/…

if the app is taken from my harddrive via network share… the folder is the app folder (correct folder).

Even more surprising !!! My friend get the app via email… it doesn’t work… He take the .app file from the app folder and put it on the desktop… Launches the app… ow it seems to try to access the sounds from the desktop… (but of course they can’t play because they are in the original app folder). then it drag drop the app file back to it’s original folder… and no… it works !!!

Thus the problem is that
File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile(soundfilename ).getFullPathName()

don’t return the right folder when the app have been downloaded from web or received by email.

My guess is that it is a problem with gatekeeper & the security preferences in osx sierra (that by default prevent you from running app from unidentified developper like me)…

Did somebody already had this problem ? Is there a better way to indicate my sound file path ?

Thanks in advance



Hi Sylvain,

Does your friend have the “App store and identified developers” option selected in the “Allow apps downloaded from:” field of Settings -> Security & Privacy -> General?



Sorry I didn’t notice you answer…

Yes of course, on my “friend computer” it is even set on “everywhere” (tried before with only app store & identified developper… I have compiles with my apple developper ID…

this is not a big issue since it’s only a matter of moving the .app to another folder and then putting it back to it’s folder to have everything working… But it’s quite strange. I did not have the opportunity to test it under previous osX version…