mirror of
https://github.com/glest/glest-source.git
synced 2025-08-23 08:22:50 +02:00
- win32 now looks/stores userdata in the default windows appdata folder: C:\Documents and Settings\All Users\Application Data\megaglest (all dev users should copy all contents of mydata into this new location).. NOT INCLUDING the mydata folder itself
This commit is contained in:
@@ -18,6 +18,12 @@
|
|||||||
#include "conversion.h"
|
#include "conversion.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "platform_common.h"
|
#include "platform_common.h"
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <shlwapi.h>
|
||||||
|
#include <Shlobj.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "leak_dumper.h"
|
#include "leak_dumper.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -92,12 +98,26 @@ bool Properties::applyTagsToValue(string &value) {
|
|||||||
#else
|
#else
|
||||||
homeDir = getenv("HOME");
|
homeDir = getenv("HOME");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
replaceAll(value, "~/", (homeDir != NULL ? homeDir : ""));
|
replaceAll(value, "~/", (homeDir != NULL ? homeDir : ""));
|
||||||
replaceAll(value, "$HOME", (homeDir != NULL ? homeDir : ""));
|
replaceAll(value, "$HOME", (homeDir != NULL ? homeDir : ""));
|
||||||
replaceAll(value, "%%HOME%%", (homeDir != NULL ? homeDir : ""));
|
replaceAll(value, "%%HOME%%", (homeDir != NULL ? homeDir : ""));
|
||||||
replaceAll(value, "%%USERPROFILE%%",(homeDir != NULL ? homeDir : ""));
|
replaceAll(value, "%%USERPROFILE%%",(homeDir != NULL ? homeDir : ""));
|
||||||
replaceAll(value, "%%HOMEPATH%%", (homeDir != NULL ? homeDir : ""));
|
replaceAll(value, "%%HOMEPATH%%", (homeDir != NULL ? homeDir : ""));
|
||||||
|
|
||||||
|
// For win32 we allow use of the appdata variable since that is the recommended
|
||||||
|
// place for application data in windows platform
|
||||||
|
#ifdef WIN32
|
||||||
|
TCHAR szPath[MAX_PATH]="";
|
||||||
|
// Get path for each computer, non-user specific and non-roaming data.
|
||||||
|
if ( SUCCEEDED( SHGetFolderPath( NULL, CSIDL_COMMON_APPDATA,
|
||||||
|
NULL, 0, szPath))) {
|
||||||
|
string appPath = szPath;
|
||||||
|
replaceAll(value, "$APPDATA", appPath);
|
||||||
|
replaceAll(value, "%%APPDATA%%", appPath);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
char *username = NULL;
|
char *username = NULL;
|
||||||
username = getenv("USERNAME");
|
username = getenv("USERNAME");
|
||||||
replaceAll(value, "$USERNAME", (username != NULL ? username : ""));
|
replaceAll(value, "$USERNAME", (username != NULL ? username : ""));
|
||||||
|
Reference in New Issue
Block a user