[SOLVED] GetResourcesPath() in the wiki lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- tintinux · 2016-07-19 13:35 Hi On this wiki page, there is a piece of code which looks wrong. 1) The name is not appropriate 2) A begin is in the wrong place 3) it refers to a TConfigurations class, not defined here 4) BundleResourcesDirectory is probably a property of this class, but unknown here. 5) The Unix and not Darwin part is certainly wrong with "myapp" as a constant. I suggest the code below working on Windows, Linux and OSX (10.6 only): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses{$ifdef Darwin}  MacOSAll,{$endif}  SysUtils; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetAppExecPath : string; {$ifdef Darwin}var  pathRef: CFURLRef;  pathCFStr: CFStringRef;  pathStr: shortstring;{$endif}begin{$ifdef Darwin}  pathRef := CFBundleCopyBundleURL(CFBundleGetMainBundle());  pathCFStr := CFURLCopyFileSystemPath(pathRef, kCFURLPOSIXPathStyle);  CFStringGetPascalString(pathCFStr, @pathStr, 255, CFStringGetSystemEncoding());  CFRelease(pathRef);  CFRelease(pathCFStr);  Result := pathStr + DirectorySeparator;{$else} // Win32 or Linux  Result := ExtractFilePath(Application.EXEName);{$endif}end;  If someone knows how to deal with Unix and not Darwin, and can test it, he his welcome, but otherwise I think it is better to remove this part. Unless someone can see something wrong, I could submit this in the bugtracker, to make a new more portable function in a next FPC or Lazarus version. Regards ---------------------------------------------------------------------- lainz · 2016-07-19 13:55 In FileUtil there is also ProgramDirectory function. Should be used instead of ExtractFilePath(Application.EXEName); ---------------------------------------------------------------------- tintinux · 2016-07-19 14:26 Ahh, thanks for the information ! It works on OS/X too, the problem is solved for me, and the whole paragraph should be removed from the Wiki Regards