+wxString wxStandardPathsBase::GetExecutablePath() const
+{
+ if ( !wxTheApp || !wxTheApp->argv )
+ return wxEmptyString;
+
+ wxString argv0 = wxTheApp->argv[0];
+ if (wxIsAbsolutePath(argv0))
+ return argv0;
+
+ // Search PATH.environment variable...
+ wxPathList pathlist;
+ pathlist.AddEnvList(wxT("PATH"));
+ wxString path = pathlist.FindAbsoluteValidPath(argv0);
+ if ( path.empty() )
+ return argv0; // better than nothing
+
+ wxFileName filename(path);
+ filename.Normalize();
+ return filename.GetFullPath();
+}
+