]> git.saurik.com Git - wxWidgets.git/commitdiff
made GetDataDir() return the directory where the program is installed under MSW
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 14 Mar 2005 16:05:52 +0000 (16:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 14 Mar 2005 16:05:52 +0000 (16:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/stdpaths.tex
src/msw/stdpaths.cpp

index acfc21b36b79f5da4f4075a13eaf682447b019d0..148dad71291664bb634e6868c2fb8695dade0e64 100644 (file)
@@ -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}
 
index 4ba9dc6d3cb6e7bf24801585898d21eeaa501af2..707c30e38341a92e4cb91a387ace6c9b0be411df 100644 (file)
@@ -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