[Bf-committers] osx install example 3

Stefan Gartner bf-committers@blender.org
Thu, 29 May 2003 19:49:38 +0200


On Thursday 29 May 2003 15:15, James Turner wrote:
> On Thursday, May 29, 2003, at 02:01  pm, Ton Roosendaal wrote:
> > Yes, but when starting an app we cannot find the location of the app
> > bundle itself... well, it requires osx specific calls I guess. Needs
> > more deeper knowledge of osx internals, something we're still > learning.
>
> Sorry, this is simplicity itself (err, if you're a Mac weenie):
>
> CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
> CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef,
>                                                 kCFURLPOSIXPathStyle);
> const char *pathPtr = CFStringGetCStringPtr(macPath,
>
> CFStringGetSystemEncoding());
>

BLI_getbundle() in source/blender/blenlib/intern/util.c already does this 
(except that it uses kCFStringEncodingASCII instead of 
CFStringGetSystemEncoding()).
Right now blender looks for language files etc. in $HOME/.blender/ and the 
Resources folder of the application bundle, which seems to be the expected 
behaviour.
Or am I missing something?

sgefant