mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-19 05:41:47 +02:00
use system folders if run as service
This commit is contained in:
parent
2cd8d0c0b7
commit
02c51b0980
5 changed files with 18 additions and 5 deletions
4
util.cpp
4
util.cpp
|
@ -168,13 +168,15 @@ namespace filesystem
|
|||
// Windows < Vista: C:\Documents and Settings\Username\Application Data\i2pd
|
||||
// Windows >= Vista: C:\Users\Username\AppData\Roaming\i2pd
|
||||
// Mac: ~/Library/Application Support/i2pd
|
||||
// Unix: ~/.i2pd
|
||||
// Unix: ~/.i2pd or /var/lib/i2pd is system=1
|
||||
#ifdef WIN32
|
||||
// Windows
|
||||
char localAppData[MAX_PATH];
|
||||
SHGetFolderPath(NULL, CSIDL_APPDATA, 0, NULL, localAppData);
|
||||
return boost::filesystem::path(std::string(localAppData) + "\\i2pd");
|
||||
#else
|
||||
if (i2p::util::config::GetArg("-service", 0)) // use system folder
|
||||
return boost::filesystem::path("/var/lib/i2pd");
|
||||
boost::filesystem::path pathRet;
|
||||
char* pszHome = getenv("HOME");
|
||||
if (pszHome == NULL || strlen(pszHome) == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue