rendered paste body CFURLRef amuleBundleUrl;
OSStatus status = LSFindApplicationForInfo(
kLSUnknownCreator,
// This magic string is the bundle identifier in aMule.app's Info.plist
CFSTR("org.amule.aMule"),
NULL,
NULL,
&amuleBundleUrl
);
if (status == noErr && amuleBundleUrl)
{
CFBundleRef amuleBundle = CFBundleCreate(NULL, amuleBundleUrl);
CFRelease(amuleBundleUrl);
if (amuleBundle)
{
CFURLRef webserverDirUrl = CFBundleCopyResourceURL(
amuleBundle,
CFSTR("webserver"),
NULL,
NULL
);
CFRelease(amuleBundle);
if (webserverDirUrl)
{
CFURLRef absoluteURL = CFURLCopyAbsoluteURL(webserverDirUrl);
CFRelease(webserverDirUrl);
if (absoluteURL)
{
CFStringRef pathString = CFURLCopyFileSystemPath(absoluteURL, kCFURLPOSIXPathStyle);
CFRelease(absoluteURL);
dir = wxMacCFStringHolder(pathString).AsString(wxLocale::GetSystemEncoding());
if (CheckDirForTemplate(dir, templateName)) {
templateDir = dir;
return true;
}
}
}
}
}