37{
38 wxFileName exe(wxStandardPaths::Get().GetExecutablePath());
39
40
41 wxString installData = exe.GetPath() + "/../share/psp-ufu/data";
42
43 wxFileName fnInstall(installData);
44 fnInstall.Normalize(wxPATH_NORM_DOTS);
45
46 if (wxDirExists(fnInstall.GetFullPath()))
47 return fnInstall.GetFullPath();
48
49
50 wxString resources = wxStandardPaths::Get().GetResourcesDir() + "/data";
51
52 if (wxDirExists(resources))
53 return resources;
54
55
56 wxString dataDir = wxStandardPaths::Get().GetDataDir() + "/data";
57
58 if (wxDirExists(dataDir))
59 return dataDir;
60
61
62 wxString portable = exe.GetPath() + "/../data";
63
64 wxFileName fn(portable);
65 fn.Normalize(wxPATH_NORM_DOTS);
66
67 if (wxDirExists(fn.GetFullPath()))
68 return fn.GetFullPath();
69
70 wxMessageDialog msgDialog(nullptr,
71 _("Data directory not found."),
72 _("Error"),
73 wxOK | wxCENTRE | wxICON_ERROR);
74
75 msgDialog.ShowModal();
76
77 return "";
78}