]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/stdpaths.cpp
Make wxPASSWORD and wxPROCESS_ENTER really deprecated.
[wxWidgets.git] / src / msw / stdpaths.cpp
index 3b815eac7b257479aa8b269099546bf7ae08614a..5e9de59ee3b2ca0bb81cb22044589ca958e6e875 100644 (file)
@@ -242,6 +242,26 @@ wxString wxStandardPaths::DoGetDirectory(int csidl)
     return dir;
 }
 
+/* static */
+wxString wxStandardPaths::GetAppDir()
+{
+    wxFileName fn(wxGetFullModuleName());
+
+    // allow running the apps directly from build directory in debug builds
+#ifdef __WXDEBUG__
+    wxString lastdir;
+    if ( fn.GetDirCount() )
+    {
+        lastdir = fn.GetDirs().Last();
+        lastdir.MakeLower();
+        if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc_msw*")) )
+            fn.RemoveLastDir();
+    }
+#endif // __WXDEBUG__
+
+    return fn.GetPath();
+}
+
 // ----------------------------------------------------------------------------
 // public functions
 // ----------------------------------------------------------------------------
@@ -260,7 +280,7 @@ wxString wxStandardPaths::GetDataDir() const
 {
     // 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();
+    return GetAppDir();
 }
 
 wxString wxStandardPaths::GetUserDataDir() const
@@ -275,10 +295,11 @@ wxString wxStandardPaths::GetUserLocalDataDir() const
 
 wxString wxStandardPaths::GetPluginsDir() const
 {
-    return wxFileName(wxGetFullModuleName()).GetPath();
+    // there is no standard location for plugins, suppose they're in the same
+    // directory as the .exe
+    return GetAppDir();
 }
 
-
 // ============================================================================
 // wxStandardPathsWin16 implementation
 // ============================================================================