2021-01-23 15:51:09 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2021-01-23 02:23:37 +00:00
|
|
|
#include <wx/filename.h>
|
2021-01-23 16:59:19 +00:00
|
|
|
#include <wx/stdpaths.h>
|
2021-01-23 02:23:37 +00:00
|
|
|
#include <wx/string.h>
|
2021-04-02 23:29:47 +00:00
|
|
|
#include <wx/utils.h>
|
2021-01-23 02:23:37 +00:00
|
|
|
|
|
|
|
#include <kiplatform/environment.h>
|
|
|
|
#include <paths.h>
|
2021-01-23 04:27:39 +00:00
|
|
|
#include <pgm_base.h>
|
2021-01-23 02:23:37 +00:00
|
|
|
#include <settings/settings_manager.h>
|
2021-01-23 16:22:39 +00:00
|
|
|
#include <config.h>
|
2021-01-23 02:23:37 +00:00
|
|
|
|
2021-01-24 03:41:58 +00:00
|
|
|
// lowercase or pretty case depending on platform
|
2022-01-31 23:57:56 +00:00
|
|
|
#if defined( __WXMAC__ ) || defined( __WXMSW__ )
|
2022-02-21 23:49:36 +00:00
|
|
|
#define KICAD_PATH_STR wxT( "KiCad" )
|
2021-01-24 03:41:58 +00:00
|
|
|
#else
|
2022-02-21 23:49:36 +00:00
|
|
|
#define KICAD_PATH_STR wxT( "kicad" )
|
2021-01-24 03:41:58 +00:00
|
|
|
#endif
|
2021-01-23 04:35:09 +00:00
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
|
|
|
|
void PATHS::getUserDocumentPath( wxFileName& aPath )
|
|
|
|
{
|
2021-02-17 01:44:42 +00:00
|
|
|
wxString envPath;
|
|
|
|
|
|
|
|
if( wxGetEnv( wxT( "KICAD_DOCUMENTS_HOME" ), &envPath ) )
|
|
|
|
aPath.AssignDir( envPath );
|
|
|
|
else
|
|
|
|
aPath.AssignDir( KIPLATFORM::ENV::GetDocumentsPath() );
|
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
aPath.AppendDir( KICAD_PATH_STR );
|
|
|
|
aPath.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-23 15:46:48 +00:00
|
|
|
wxString PATHS::GetUserPluginsPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
2021-01-28 02:06:13 +00:00
|
|
|
getUserDocumentPath( tmp );
|
2021-01-23 15:46:48 +00:00
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "plugins" ) );
|
2021-01-23 15:46:48 +00:00
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
return tmp.GetPath();
|
2021-01-23 15:46:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetUserPlugins3DPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
|
|
|
|
|
|
|
tmp.AssignDir( PATHS::GetUserPluginsPath() );
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "3d" ) );
|
2021-01-23 15:46:48 +00:00
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
return tmp.GetPath();
|
2021-01-23 15:46:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-23 02:23:37 +00:00
|
|
|
wxString PATHS::GetUserScriptingPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
2021-01-28 02:06:13 +00:00
|
|
|
getUserDocumentPath( tmp );
|
2021-01-23 02:23:37 +00:00
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "scripting" ) );
|
2021-01-23 02:23:37 +00:00
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
return tmp.GetPath();
|
2021-01-23 02:23:37 +00:00
|
|
|
}
|
|
|
|
|
2021-01-23 04:17:32 +00:00
|
|
|
|
2021-01-23 02:23:37 +00:00
|
|
|
wxString PATHS::GetUserTemplatesPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
2021-01-28 02:06:13 +00:00
|
|
|
getUserDocumentPath( tmp );
|
2021-01-23 02:23:37 +00:00
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "template" ) );
|
2021-01-23 02:23:37 +00:00
|
|
|
|
2021-02-01 04:57:41 +00:00
|
|
|
return tmp.GetPathWithSep();
|
2021-01-28 02:06:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetDefaultUserSymbolsPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
|
|
|
getUserDocumentPath( tmp );
|
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "symbols" ) );
|
2021-01-28 02:06:13 +00:00
|
|
|
|
|
|
|
return tmp.GetPath();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetDefaultUserFootprintsPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
|
|
|
getUserDocumentPath( tmp );
|
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "footprints" ) );
|
2021-01-28 02:06:13 +00:00
|
|
|
|
|
|
|
return tmp.GetPath();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetDefaultUser3DModelsPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
|
|
|
getUserDocumentPath( tmp );
|
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "3dmodels" ) );
|
2021-01-28 02:06:13 +00:00
|
|
|
|
|
|
|
return tmp.GetPath();
|
2021-01-23 04:17:32 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 18:39:45 +00:00
|
|
|
wxString PATHS::GetDefault3rdPartyPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
|
|
|
getUserDocumentPath( tmp );
|
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "3rdparty" ) );
|
2020-12-08 18:39:45 +00:00
|
|
|
|
|
|
|
return tmp.GetPath();
|
|
|
|
}
|
2021-01-23 04:17:32 +00:00
|
|
|
|
|
|
|
wxString PATHS::GetDefaultUserProjectsPath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
2021-01-28 02:06:13 +00:00
|
|
|
getUserDocumentPath( tmp );
|
2021-01-23 04:17:32 +00:00
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
tmp.AppendDir( wxT( "projects" ) );
|
2021-01-23 04:17:32 +00:00
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
return tmp.GetPath();
|
2021-01-23 04:27:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-20 15:41:34 +00:00
|
|
|
wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
|
2021-01-23 04:27:39 +00:00
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2021-03-20 15:41:34 +00:00
|
|
|
if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
2021-01-23 04:27:39 +00:00
|
|
|
{
|
2021-03-08 02:59:07 +00:00
|
|
|
// Allow debugging from build dir by placing relevant files/folders in the build root
|
2022-01-31 23:57:56 +00:00
|
|
|
#if defined( __WXMAC__ )
|
2021-04-29 03:21:19 +00:00
|
|
|
wxFileName fn = wxStandardPaths::Get().GetExecutablePath();
|
|
|
|
|
|
|
|
fn.RemoveLastDir();
|
|
|
|
fn.RemoveLastDir();
|
|
|
|
fn.RemoveLastDir();
|
|
|
|
fn.RemoveLastDir();
|
|
|
|
path = fn.GetPath();
|
2021-06-21 22:05:38 +00:00
|
|
|
#elif defined( __WXMSW__ )
|
2021-06-21 22:03:44 +00:00
|
|
|
path = getWindowsKiCadRoot();
|
2021-06-21 22:05:38 +00:00
|
|
|
#else
|
|
|
|
path = Pgm().GetExecutablePath() + wxT( ".." );
|
2021-04-29 03:21:19 +00:00
|
|
|
#endif
|
2021-01-23 04:27:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-31 23:57:56 +00:00
|
|
|
#if defined( __WXMAC__ )
|
2021-03-08 02:59:07 +00:00
|
|
|
path = GetOSXKicadDataDir();
|
2021-01-23 04:27:39 +00:00
|
|
|
#elif defined( __WXMSW__ )
|
2021-06-21 22:03:44 +00:00
|
|
|
path = getWindowsKiCadRoot() + wxT( "share/kicad" );
|
2021-01-23 04:27:39 +00:00
|
|
|
#else
|
2021-03-08 02:59:07 +00:00
|
|
|
path = wxString::FromUTF8Unchecked( KICAD_DATA );
|
2021-01-23 04:27:39 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
return path;
|
2021-01-23 15:46:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-29 13:37:11 +00:00
|
|
|
wxString PATHS::GetStockEDALibraryPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2022-01-31 23:57:56 +00:00
|
|
|
#if defined( __WXMAC__ )
|
2021-03-29 13:37:11 +00:00
|
|
|
path = GetOSXKicadMachineDataDir();
|
|
|
|
#elif defined( __WXMSW__ )
|
|
|
|
path = GetStockDataPath( false );
|
|
|
|
#else
|
|
|
|
path = wxString::FromUTF8Unchecked( KICAD_LIBRARY_DATA );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-12-02 01:23:34 +00:00
|
|
|
wxString PATHS::GetStockSymbolsPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2022-03-24 21:02:05 +00:00
|
|
|
path = GetStockEDALibraryPath() + wxT( "/symbols" );
|
2021-12-02 01:23:34 +00:00
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetStockFootprintsPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2022-03-24 21:02:05 +00:00
|
|
|
path = GetStockEDALibraryPath() + wxT( "/footprints" );
|
2021-12-02 01:23:34 +00:00
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetStock3dmodelsPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2022-03-24 21:02:05 +00:00
|
|
|
path = GetStockEDALibraryPath() + wxT( "/3dmodels" );
|
2021-12-02 01:23:34 +00:00
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-08 02:59:07 +00:00
|
|
|
wxString PATHS::GetStockScriptingPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2021-03-20 15:41:34 +00:00
|
|
|
path = GetStockDataPath() + wxT( "/scripting" );
|
2021-03-08 02:59:07 +00:00
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-21 17:21:20 +00:00
|
|
|
wxString PATHS::GetStockTemplatesPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2022-03-24 21:02:05 +00:00
|
|
|
path = GetStockEDALibraryPath() + wxT( "/template" );
|
2022-02-21 17:21:20 +00:00
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-21 18:04:08 +00:00
|
|
|
wxString PATHS::GetLocaleDataPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
|
|
|
path = GetStockDataPath() + wxT( "/internat" );
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-23 15:46:48 +00:00
|
|
|
wxString PATHS::GetStockPluginsPath()
|
|
|
|
{
|
|
|
|
wxFileName fn;
|
|
|
|
|
2021-03-20 15:41:34 +00:00
|
|
|
#if defined( __WXMSW__ )
|
|
|
|
fn.AssignDir( Pgm().GetExecutablePath() );
|
2021-04-09 02:16:20 +00:00
|
|
|
fn.AppendDir( wxT( "scripting" ) );
|
2021-01-23 15:46:48 +00:00
|
|
|
#else
|
2021-03-20 15:41:34 +00:00
|
|
|
fn.AssignDir( PATHS::GetStockDataPath( false ) );
|
2021-01-23 15:46:48 +00:00
|
|
|
#endif
|
2021-03-20 15:41:34 +00:00
|
|
|
fn.AppendDir( wxT( "plugins" ) );
|
2021-01-23 15:46:48 +00:00
|
|
|
|
|
|
|
return fn.GetPathWithSep();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetStockPlugins3DPath()
|
|
|
|
{
|
|
|
|
wxFileName fn;
|
|
|
|
|
2021-03-08 13:49:21 +00:00
|
|
|
#ifdef __WXGTK__
|
2021-03-01 20:02:47 +00:00
|
|
|
// KICAD_PLUGINDIR = CMAKE_INSTALL_FULL_LIBDIR path is the absolute path
|
|
|
|
// corresponding to the install path used for constructing KICAD_USER_PLUGIN
|
|
|
|
wxString tfname = wxString::FromUTF8Unchecked( KICAD_PLUGINDIR );
|
|
|
|
fn.Assign( tfname, "" );
|
|
|
|
fn.AppendDir( wxT( "kicad" ) );
|
|
|
|
fn.AppendDir( wxT( "plugins" ) );
|
2022-01-31 23:57:56 +00:00
|
|
|
#elif defined( __WXMAC__ )
|
2021-03-29 21:07:37 +00:00
|
|
|
fn.Assign( wxStandardPaths::Get().GetPluginsDir(), wxEmptyString );
|
2021-03-01 20:02:47 +00:00
|
|
|
#else
|
2021-04-09 02:16:20 +00:00
|
|
|
fn.AssignDir( Pgm().GetExecutablePath() );
|
|
|
|
fn.AppendDir( wxT( "plugins" ) );
|
2021-03-01 20:02:47 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-21 23:49:36 +00:00
|
|
|
fn.AppendDir( wxT( "3d" ) );
|
2021-01-23 15:46:48 +00:00
|
|
|
|
|
|
|
return fn.GetPathWithSep();
|
2021-01-23 16:59:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-26 01:58:44 +00:00
|
|
|
wxString PATHS::GetStockDemosPath()
|
|
|
|
{
|
|
|
|
wxFileName fn;
|
|
|
|
|
|
|
|
fn.AssignDir( PATHS::GetStockDataPath( false ) );
|
|
|
|
fn.AppendDir( wxT( "demos" ) );
|
|
|
|
|
|
|
|
return fn.GetPathWithSep();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-23 16:59:19 +00:00
|
|
|
wxString PATHS::GetUserCachePath()
|
|
|
|
{
|
|
|
|
wxFileName tmp;
|
|
|
|
|
2021-01-28 00:11:39 +00:00
|
|
|
tmp.AssignDir( KIPLATFORM::ENV::GetUserCachePath() );
|
2021-01-24 03:41:58 +00:00
|
|
|
tmp.AppendDir( KICAD_PATH_STR );
|
2021-01-23 16:59:19 +00:00
|
|
|
tmp.AppendDir( SETTINGS_MANAGER::GetSettingsVersion() );
|
|
|
|
|
|
|
|
return tmp.GetPathWithSep();
|
2021-01-28 02:06:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-05 17:05:42 +00:00
|
|
|
wxString PATHS::GetDocumentationPath()
|
|
|
|
{
|
|
|
|
wxString path;
|
|
|
|
|
2022-01-31 23:57:56 +00:00
|
|
|
#if defined( __WXMAC__ )
|
2021-04-05 17:05:42 +00:00
|
|
|
path = GetOSXKicadDataDir();
|
|
|
|
#elif defined( __WXMSW__ )
|
2022-02-21 23:49:36 +00:00
|
|
|
path = getWindowsKiCadRoot() + wxT( "share/doc/kicad" );
|
2021-04-05 17:05:42 +00:00
|
|
|
#else
|
|
|
|
path = wxString::FromUTF8Unchecked( KICAD_DOCS );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
bool PATHS::EnsurePathExists( const wxString& aPath )
|
|
|
|
{
|
|
|
|
wxFileName path( aPath );
|
|
|
|
if( !path.Normalize() )
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !wxFileName::DirExists( aPath ) )
|
|
|
|
{
|
|
|
|
if( !wxFileName::Mkdir( aPath, wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void PATHS::EnsureUserPathsExist()
|
|
|
|
{
|
|
|
|
EnsurePathExists( GetUserPluginsPath() );
|
|
|
|
EnsurePathExists( GetUserPlugins3DPath() );
|
|
|
|
EnsurePathExists( GetUserScriptingPath() );
|
2021-02-01 04:57:41 +00:00
|
|
|
EnsurePathExists( GetUserTemplatesPath() );
|
2021-01-28 02:06:13 +00:00
|
|
|
EnsurePathExists( GetDefaultUserProjectsPath() );
|
|
|
|
EnsurePathExists( GetDefaultUserSymbolsPath() );
|
|
|
|
EnsurePathExists( GetDefaultUserFootprintsPath() );
|
|
|
|
EnsurePathExists( GetDefaultUser3DModelsPath() );
|
2020-12-08 18:39:45 +00:00
|
|
|
EnsurePathExists( GetDefault3rdPartyPath() );
|
2021-02-17 01:44:42 +00:00
|
|
|
}
|
2021-02-17 04:26:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __WXMAC__
|
|
|
|
wxString PATHS::GetOSXKicadUserDataDir()
|
|
|
|
{
|
|
|
|
// According to wxWidgets documentation for GetUserDataDir:
|
|
|
|
// Mac: ~/Library/Application Support/appname
|
|
|
|
wxFileName udir( wxStandardPaths::Get().GetUserDataDir(), wxEmptyString );
|
|
|
|
|
|
|
|
// Since appname is different if started via launcher or standalone binary
|
|
|
|
// map all to "kicad" here
|
|
|
|
udir.RemoveLastDir();
|
2022-02-21 23:49:36 +00:00
|
|
|
udir.AppendDir( wxT( "kicad" ) );
|
2021-02-17 04:26:46 +00:00
|
|
|
|
|
|
|
return udir.GetPath();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetOSXKicadMachineDataDir()
|
|
|
|
{
|
2021-11-13 00:24:49 +00:00
|
|
|
// 6.0 forward: Same as the main data dir
|
|
|
|
return GetOSXKicadDataDir();
|
2021-02-17 04:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString PATHS::GetOSXKicadDataDir()
|
|
|
|
{
|
|
|
|
// According to wxWidgets documentation for GetDataDir:
|
|
|
|
// Mac: appname.app/Contents/SharedSupport bundle subdirectory
|
|
|
|
wxFileName ddir( wxStandardPaths::Get().GetDataDir(), wxEmptyString );
|
|
|
|
|
|
|
|
// This must be mapped to main bundle for everything but kicad.app
|
|
|
|
const wxArrayString dirs = ddir.GetDirs();
|
2021-08-13 20:37:15 +00:00
|
|
|
|
|
|
|
// Check if we are the main kicad binary. in this case, the path will be
|
|
|
|
// /path/to/bundlename.app/Contents/SharedSupport
|
|
|
|
// If we are an aux binary, the path will be something like
|
|
|
|
// /path/to/bundlename.app/Contents/Applications/<standalone>.app/Contents/SharedSupport
|
|
|
|
if( dirs.GetCount() >= 6 &&
|
|
|
|
dirs[dirs.GetCount() - 4] == wxT( "Applications" ) &&
|
|
|
|
dirs[dirs.GetCount() - 6].Lower().EndsWith( wxT( "app" ) ) )
|
2021-02-17 04:26:46 +00:00
|
|
|
{
|
|
|
|
ddir.RemoveLastDir();
|
|
|
|
ddir.RemoveLastDir();
|
|
|
|
ddir.RemoveLastDir();
|
|
|
|
ddir.RemoveLastDir();
|
|
|
|
ddir.AppendDir( wxT( "SharedSupport" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
return ddir.GetPath();
|
|
|
|
}
|
2021-02-27 00:00:39 +00:00
|
|
|
#endif
|
2021-06-21 22:03:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __WXWINDOWS__
|
|
|
|
wxString PATHS::getWindowsKiCadRoot()
|
|
|
|
{
|
2022-02-21 23:49:36 +00:00
|
|
|
wxFileName root( Pgm().GetExecutablePath() + wxT( "/../" ) );
|
2021-06-21 22:07:07 +00:00
|
|
|
root.Normalize();
|
2021-06-21 22:03:44 +00:00
|
|
|
|
|
|
|
return root.GetPathWithSep();
|
|
|
|
}
|
|
|
|
#endif
|