New unzipped app shows /private/var/folders as working dir with _NS

Disclaimer; this is a cross platform tool that isn't being installed in the traditional manner; instead it's being launched directly out of an unzipped zip. Tested on Mojave and Yosemite
Language: C++
Compiler: clang

Built system: CMake


Essentially, a lot of times, after the app is unzipped and launched, say in ~/Downloads/myApp-R123/myapp.app , when I check to see what it thinks is the exe path is using _NSGetExecutablePath(); It'll report back that it's in a /private/var/folders prefixed path, as opposed to the anticpated ~/Downloads/myApp-R123.


Where it first becomes interesting is if I move the unzipped folder to another locations (ie, ~/random/myApp-R123 ) it will often then correctly report, but, the real twister is, if I move it back to the ~/Downloads/myApp-R123 it remains working and reporting the correct/anticipated path.


My question is; is there some manner of virtual filesystem going on here?
If this is a vfs situation, Is there something in the Info.plist I can add to prevent that? Is there a proper way to unzip to ensure it doesn't behave this way?


Regards,

Paul.

Replies

It would appear it's something to do with AppTranslocation process.


Interesting that it will go away after a period of time or moving things around.
I'm suspecting by signing up as a known-developer I may be able to bypass/resolve this situation more directly?

Updating for my own information and future searchers;


To resolve this, it appears you can fix it using the xattr command to remove the ranslocation / virtual-folder situation


xattr -dr com.apple.quarantine ./folder/of/interest