From a5d086f6c1a0544965ac7d9a3db94363ab2b936b Mon Sep 17 00:00:00 2001 From: Mathias Gruber Date: Sun, 3 Jan 2021 23:02:45 +0100 Subject: [PATCH] Fixed crashes related to fixed paths on OSX Fixed path resolution to application resources relative to the application bundle, allowing the application to run in any path. --- main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.cpp b/main.cpp index 8536b77..723f1aa 100644 --- a/main.cpp +++ b/main.cpp @@ -290,6 +290,12 @@ bool MyApp::OnInit() //SetCurrentDirectoryW(ExtractFilePath(buf).c_str() ); g_res_path=ConvertToUTF8(ExtractFilePath(buf))+"\\"; res_path=wxString(g_res_path.c_str(), wxMBConvUTF8()); +#elif defined(__APPLE__) + wxFileName base(wxStandardPaths::Get().GetExecutablePath()); + base.AppendDir(wxT("share")); + base.AppendDir(wxT("urbackup")); + res_path=base.GetPathWithSep(); + g_res_path=res_path; #else res_path=wxT(DATADIR "/urbackup/"); g_res_path= DATADIR "/urbackup/";