steam_helper: create Config directory

This is checked by CEG.

CW-Bug-Id: #15930
This commit is contained in:
Pierre-Loup A. Griffais 2021-10-25 18:40:05 -07:00 committed by Arkadiusz Hiler
parent 8d9c45a6f6
commit f2ff463c08

View file

@ -1061,8 +1061,9 @@ static BOOL steam_protocol_handler(int argc, char *argv[])
static void setup_steam_files(void)
{
static const WCHAR libraryfolders_nameW[] = L"C:\\Program Files (x86)\\Steam\\steamapps\\libraryfolders.vdf";
static const WCHAR config_pathW[] = L"C:\\Program Files (x86)\\Steam\\config";
static const WCHAR steamapps_pathW[] = L"C:\\Program Files (x86)\\Steam\\steamapps";
static const WCHAR libraryfolders_nameW[] = L"C:\\Program Files (x86)\\Steam\\steamapps\\libraryfolders.vdf";
const char *steam_install_path = getenv("STEAM_COMPAT_CLIENT_INSTALL_PATH");
const char *steam_library_paths = getenv("STEAM_COMPAT_LIBRARY_PATHS");
const char *start, *end, *next;
@ -1070,6 +1071,12 @@ static void setup_steam_files(void)
std::string contents;
char idx_str[10];
if (!CreateDirectoryW(config_pathW, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
{
WINE_ERR("Failed to create config directory, GetLastError() %u.\n", GetLastError());
return;
}
if (!CreateDirectoryW(steamapps_pathW, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
{
WINE_ERR("Failed to create steamapps directory, GetLastError() %u.\n", GetLastError());