mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
system: use %LOCALAPPDATA% as default datadir on windows
This commit is contained in:
parent
312f54278f
commit
855dd8d592
4 changed files with 12 additions and 5 deletions
|
|
@ -696,12 +696,19 @@ bool HasTestOption(const ArgsManager& args, const std::string& test_option)
|
|||
|
||||
fs::path GetDefaultDataDir()
|
||||
{
|
||||
// Windows: C:\Users\Username\AppData\Roaming\Bitcoin
|
||||
// Windows:
|
||||
// old: C:\Users\Username\AppData\Roaming\Bitcoin
|
||||
// new: C:\Users\Username\AppData\Local\Bitcoin
|
||||
// macOS: ~/Library/Application Support/Bitcoin
|
||||
// Unix-like: ~/.bitcoin
|
||||
#ifdef WIN32
|
||||
// Windows
|
||||
return GetSpecialFolderPath(CSIDL_APPDATA) / "Bitcoin";
|
||||
// Check for existence of datadir in old location and keep it there
|
||||
fs::path legacy_path = GetSpecialFolderPath(CSIDL_APPDATA) / "Bitcoin";
|
||||
if (fs::exists(legacy_path)) return legacy_path;
|
||||
|
||||
// Otherwise, fresh installs can start in the new, "proper" location
|
||||
return GetSpecialFolderPath(CSIDL_LOCAL_APPDATA) / "Bitcoin";
|
||||
#else
|
||||
fs::path pathRet;
|
||||
char* pszHome = getenv("HOME");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue