mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 22:27:43 +00:00
Windows sync fixes for API changes
This commit is contained in:
@@ -23,16 +23,16 @@ hecl::SystemString FindCommonSteamApp(const hecl::SystemChar* name)
|
||||
#if !WINDOWS_STORE
|
||||
HKEY hkey;
|
||||
hecl::SystemChar _steamInstallDir[MAX_PATH] = {0};
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _S("Software\\Valve\\Steam"),
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _SYS_STR("Software\\Valve\\Steam"),
|
||||
0, KEY_QUERY_VALUE, &hkey) != ERROR_SUCCESS)
|
||||
{
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _S("Software\\Valve\\Steam"),
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _SYS_STR("Software\\Valve\\Steam"),
|
||||
0, KEY_QUERY_VALUE | KEY_WOW64_32KEY, &hkey) != ERROR_SUCCESS)
|
||||
return {};
|
||||
}
|
||||
|
||||
DWORD size = MAX_PATH;
|
||||
if (RegQueryValueEx(hkey, _S("InstallPath"), nullptr, nullptr,
|
||||
if (RegQueryValueEx(hkey, _SYS_STR("InstallPath"), nullptr, nullptr,
|
||||
(LPBYTE)_steamInstallDir, &size) == ERROR_SUCCESS)
|
||||
steamInstallDir = _steamInstallDir;
|
||||
RegCloseKey(hkey);
|
||||
@@ -62,17 +62,17 @@ hecl::SystemString FindCommonSteamApp(const hecl::SystemChar* name)
|
||||
|
||||
#endif
|
||||
|
||||
hecl::SystemString appPath = hecl::SystemString(_S("common")) + PATH_SEP + name;
|
||||
hecl::SystemString appPath = hecl::SystemString(_SYS_STR("common")) + PATH_SEP + name;
|
||||
|
||||
/* Try main steam install directory first */
|
||||
hecl::SystemString steamAppsMain = steamInstallDir + PATH_SEP + _S("steamapps");
|
||||
hecl::SystemString steamAppsMain = steamInstallDir + PATH_SEP + _SYS_STR("steamapps");
|
||||
hecl::SystemString mainAppPath = steamAppsMain + PATH_SEP + appPath;
|
||||
if (!hecl::Stat(mainAppPath.c_str(), &theStat) && S_ISDIR(theStat.st_mode))
|
||||
return mainAppPath;
|
||||
|
||||
/* Iterate alternate steam install dirs */
|
||||
hecl::SystemString libraryFoldersVdfPath = steamAppsMain + PATH_SEP + _S("libraryfolders.vdf");
|
||||
FILE* fp = hecl::Fopen(libraryFoldersVdfPath.c_str(), _S("r"));
|
||||
hecl::SystemString libraryFoldersVdfPath = steamAppsMain + PATH_SEP + _SYS_STR("libraryfolders.vdf");
|
||||
FILE* fp = hecl::Fopen(libraryFoldersVdfPath.c_str(), _SYS_STR("r"));
|
||||
if (!fp)
|
||||
return {};
|
||||
hecl::FSeek(fp, 0, SEEK_END);
|
||||
@@ -100,7 +100,7 @@ hecl::SystemString FindCommonSteamApp(const hecl::SystemChar* name)
|
||||
std::string match = dirMatch[1].str();
|
||||
hecl::SystemStringConv otherInstallDir(match);
|
||||
hecl::SystemString otherAppPath = hecl::SystemString(otherInstallDir.sys_str()) + PATH_SEP +
|
||||
_S("steamapps") + PATH_SEP + appPath;
|
||||
_SYS_STR("steamapps") + PATH_SEP + appPath;
|
||||
if (!hecl::Stat(otherAppPath.c_str(), &theStat) && S_ISDIR(theStat.st_mode))
|
||||
return otherAppPath;
|
||||
begin = dirMatch.suffix().first;
|
||||
|
||||
Reference in New Issue
Block a user