install and run from Documents folder on windows, seems games do that these days

This commit is contained in:
Tim Felgentreff 2020-11-29 14:28:34 +01:00
parent 675a8abfd3
commit 0a5e65d7fe
2 changed files with 6 additions and 2 deletions

View file

@ -187,7 +187,8 @@ stratagus-game-launcher.h - Stratagus Game Launcher
static void SetUserDataPath(char* data_path) {
#if defined(WIN32)
strcpy(data_path, getenv("APPDATA"));
SHGetFolderPathA(NULL, CSIDL_PERSONAL|CSIDL_FLAG_CREATE, NULL, 0, data_path)))
// strcpy(data_path, getenv("APPDATA"));
#else
strcpy(data_path, getenv("HOME"));
#endif

View file

@ -51,7 +51,10 @@ void Parameters::SetDefaultUserDirectory()
#ifdef USE_GAME_DIR
userDirectory = StratagusLibPath;
#elif USE_WIN32
userDirectory = getenv("APPDATA");
char data_path[MAX_PATH] = {'\0'};
SHGetFolderPathA(NULL, CSIDL_PERSONAL|CSIDL_FLAG_CREATE, NULL, 0, data_path)))
userDirectory = data_path;
// userDirectory = getenv("APPDATA");
#else
userDirectory = getenv("HOME");
#endif