Commit 6d257550 authored by Pierre Kim's avatar Pierre Kim

1.2.1.2 - Fix non latin directory bug

parent ca084172
......@@ -314,6 +314,51 @@ std::string get_nix_version_display_string()
return config_folder;
}
#ifdef WIN32
std::wstring get_special_folder_path_w(int nfolder, bool iscreate)
{
namespace fs = boost::filesystem;
wchar_t wsz_path[MAX_PATH] = L"";
if (SHGetSpecialFolderPathW(NULL, wsz_path, nfolder, iscreate)) {
return wsz_path;
}
return L"";
}
#endif
std::wstring getDefaultDataDirectoryW()
{
//namespace fs = boost::filesystem;
// Windows < Vista: C:\Documents and Settings\Username\Application Data\CRYPTONOTE_NAME
// Windows >= Vista: C:\Users\Username\AppData\Roaming\CRYPTONOTE_NAME
// Mac: ~/Library/Application Support/CRYPTONOTE_NAME
// Unix: ~/.CRYPTONOTE_NAME
std::wstring config_folder;
#ifdef WIN32
// Windows
config_folder = get_special_folder_path_w(CSIDL_APPDATA, true) + L"\\manateecoin";
#else
std::string pathRet;
char* pszHome = getenv("HOME");
if (pszHome == NULL || strlen(pszHome) == 0)
pathRet = "/";
else
pathRet = pszHome;
#ifdef MAC_OSX
// Mac
pathRet /= "Library/Application Support";
config_folder = (pathRet + "/" + CryptoNote::CRYPTONOTE_NAME);
#else
// Unix
config_folder = (pathRet + "/." + CryptoNote::CRYPTONOTE_NAME);
#endif
#endif
return config_folder;
}
bool create_directories_if_necessary(const std::string& path)
{
namespace fs = boost::filesystem;
......
......@@ -10,6 +10,7 @@
namespace Tools
{
std::string getDefaultDataDirectory();
std::wstring getDefaultDataDirectoryW();
std::string get_os_version_string();
bool create_directories_if_necessary(const std::string& path);
std::error_code replace_file(const std::string& replacement_name, const std::string& replaced_name);
......
#define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "1.2.1"
#define PROJECT_VERSION_BUILD_NO "1"
#define PROJECT_VERSION_BUILD_NO "2"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment