Prototype
Prototype copied to clipboard
Steam Install Auto-Detect 2.0
Spinning off of #442 ... (tagging @pcen , thanks for confirming how it works on Win11)
Based on our limited sample size, it appears that on Windows 11, the Civ III install path is not set in the registry upon installing the game via Steam. The PR listed above added a check for Civ III in the default Steam folder.
However, not everyone installs Steam to the default folder, and even for those who do, they may install games on a secondary drive. This issue is to handle those cases.
For the first part, it looks like the install path is stored in the registry at Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Valve\Steam
, with the InstallPath
key; in my case it is C:\Games\Steam
. This will let you know where Steam is installed, and Civ III can be checked for in that location.
If it isn't found there, the file
"InstallConfigStore"
{
"Software"
{
"valve"
{
"Steam"
{
"BaseInstallFolder_1" "D:\\Games\\Steam Library"
"BaseInstallFolder_2" "G:\\Games\\Steam"
These BaseInstallFolder entries list other Steam directories. Game folders are within the steamapps/common
sub-directories of those, just like within the main Steam folder.
The combination of these two steps should theoretically find Civ III reliably whenever it is installed by Steam. We already theoretically have the CD case covered (as in theory it should always set the registry, particularly as the CD implies Windows 8.1 or earlier due to SecuROM being removed in Win10), which leaves GOG detection (when it doesn't set the registry) as the remaining follow up once this one is done.
(@WildWeazel Any pointers on how to detect the Steam install location on Linux? I don't suppose Proton emulates the Windows registry for us? Depending on the complexity it may or may not warrant a spin-off ticket)