mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-23 20:52:54 +00:00
Use Windows uninstall path to find Steam Quake 3 install.
Thanks Pan- and Ensiform for pointing this out.
This commit is contained in:
parent
3bd7a8d842
commit
2f77a98afe
2 changed files with 36 additions and 11 deletions
|
@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define HOMEPATH_NAME_WIN "FooBar"
|
||||
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
|
||||
// #define STEAMPATH_NAME "Foo Bar"
|
||||
// #define STEAMPATH_APPID ""
|
||||
#define GAMENAME_FOR_MASTER "foobar" // must NOT contain whitespace
|
||||
// #define LEGACY_PROTOCOL // You probably don't need this for your standalone game
|
||||
#else
|
||||
|
@ -46,6 +47,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define HOMEPATH_NAME_WIN "Quake3"
|
||||
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
|
||||
#define STEAMPATH_NAME "Quake 3 Arena"
|
||||
#define STEAMPATH_APPID "2200"
|
||||
#define GAMENAME_FOR_MASTER "Quake3Arena"
|
||||
#define LEGACY_PROTOCOL
|
||||
#endif
|
||||
|
|
|
@ -136,29 +136,52 @@ Sys_SteamPath
|
|||
*/
|
||||
char *Sys_SteamPath( void )
|
||||
{
|
||||
#ifdef STEAMPATH_NAME
|
||||
#if defined(STEAMPATH_NAME) || defined(STEAMPATH_APPID)
|
||||
HKEY steamRegKey;
|
||||
DWORD pathLen = MAX_OSPATH;
|
||||
qboolean finishPath = qfalse;
|
||||
#endif
|
||||
|
||||
if (!RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Valve\\Steam", 0, KEY_QUERY_VALUE, &steamRegKey))
|
||||
#ifdef STEAMPATH_APPID
|
||||
if (!steamPath[0] && !RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App " STEAMPATH_APPID, 0, KEY_QUERY_VALUE, &steamRegKey))
|
||||
{
|
||||
DWORD pathLen = MAX_OSPATH;
|
||||
pathLen = MAX_OSPATH;
|
||||
if (RegQueryValueEx(steamRegKey, "InstallLocation", NULL, NULL, (LPBYTE)steamPath, &pathLen))
|
||||
steamPath[0] = '\0';
|
||||
}
|
||||
|
||||
if (!steamPath[0] && !RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App " STEAMPATH_APPID, 0, KEY_QUERY_VALUE, &steamRegKey))
|
||||
{
|
||||
pathLen = MAX_OSPATH;
|
||||
if (RegQueryValueEx(steamRegKey, "InstallLocation", NULL, NULL, (LPBYTE)steamPath, &pathLen))
|
||||
steamPath[0] = '\0';
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef STEAMPATH_NAME
|
||||
if (!steamPath[0] && !RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Valve\\Steam", 0, KEY_QUERY_VALUE, &steamRegKey))
|
||||
{
|
||||
pathLen = MAX_OSPATH;
|
||||
if (RegQueryValueEx(steamRegKey, "SteamPath", NULL, NULL, (LPBYTE)steamPath, &pathLen))
|
||||
if (RegQueryValueEx(steamRegKey, "InstallPath", NULL, NULL, (LPBYTE)steamPath, &pathLen))
|
||||
steamPath[0] = '\0';
|
||||
|
||||
if (steamPath[0])
|
||||
{
|
||||
if (pathLen == MAX_OSPATH)
|
||||
pathLen--;
|
||||
|
||||
steamPath[pathLen] = '\0';
|
||||
|
||||
Q_strcat(steamPath, MAX_OSPATH, "\\SteamApps\\common\\" STEAMPATH_NAME );
|
||||
}
|
||||
finishPath = qtrue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (steamPath[0])
|
||||
{
|
||||
if (pathLen == MAX_OSPATH)
|
||||
pathLen--;
|
||||
|
||||
steamPath[pathLen] = '\0';
|
||||
|
||||
if (finishPath)
|
||||
Q_strcat(steamPath, MAX_OSPATH, "\\SteamApps\\common\\" STEAMPATH_NAME );
|
||||
}
|
||||
|
||||
return steamPath;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue