From: Vadim Zeitlin Date: Mon, 14 Mar 2005 16:05:52 +0000 (+0000) Subject: made GetDataDir() return the directory where the program is installed under MSW X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/905372991fb9872a7ea82991055a34e161ea29c3 made GetDataDir() return the directory where the program is installed under MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/stdpaths.tex b/docs/latex/wx/stdpaths.tex index acfc21b36b..148dad7129 100644 --- a/docs/latex/wx/stdpaths.tex +++ b/docs/latex/wx/stdpaths.tex @@ -83,7 +83,7 @@ data files. Example return values: \begin{itemize} \item Unix: \texttt{\textit{prefix}/share/\textit{appname}} - \item Windows: \texttt{C:$\backslash$Program Files$\backslash$\textit{appname}} + \item Windows: the directory where the executable file is located \item Mac: \texttt{\textit{appname}.app/Contents/SharedSupport} bundle subdirectory \end{itemize} diff --git a/src/msw/stdpaths.cpp b/src/msw/stdpaths.cpp index 4ba9dc6d3c..707c30e383 100644 --- a/src/msw/stdpaths.cpp +++ b/src/msw/stdpaths.cpp @@ -246,7 +246,9 @@ wxString wxStandardPaths::GetUserConfigDir() const wxString wxStandardPaths::GetDataDir() const { - return AppendAppName(DoGetDirectory(CSIDL_PROGRAM_FILES)); + // under Windows each program is usually installed in its own directory and + // so its datafiles are in the same directory as its main executable + return wxFileName(wxGetFullModuleName()).GetPath(); } wxString wxStandardPaths::GetUserDataDir() const