diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-17 15:06:04 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-17 15:06:04 -0500 |
commit | cfe2c3975f8be62581195fbfffc41528f22b2ee3 (patch) | |
tree | 47998fbefecf44f3e5b375a04c15369ec558cad6 /build/find-game-folder.targets | |
parent | 516b2fc010ba9a794297ae74b4c5de321ffd0a70 (diff) | |
download | SMAPI-cfe2c3975f8be62581195fbfffc41528f22b2ee3.tar.gz SMAPI-cfe2c3975f8be62581195fbfffc41528f22b2ee3.tar.bz2 SMAPI-cfe2c3975f8be62581195fbfffc41528f22b2ee3.zip |
prefer GOG/Steam registry paths when scanning for game folder
Diffstat (limited to 'build/find-game-folder.targets')
-rw-r--r-- | build/find-game-folder.targets | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/build/find-game-folder.targets b/build/find-game-folder.targets index a4200662..02abb54b 100644 --- a/build/find-game-folder.targets +++ b/build/find-game-folder.targets @@ -20,6 +20,14 @@ </When> <When Condition="$(OS) == 'Windows_NT'"> <PropertyGroup> + <!-- registry paths --> + <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32))</GamePath> + <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32))</GamePath> + + <!-- derive from Steam library path --> + <_SteamLibraryPath>$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Valve\Steam', 'SteamPath', null, RegistryView.Registry32))</_SteamLibraryPath> + <GamePath Condition="!Exists('$(GamePath)') AND '$(_SteamLibraryPath)' != ''">$(_SteamLibraryPath)\steamapps\common\Stardew Valley</GamePath> + <!-- default paths --> <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files\GalaxyClient\Games\Stardew Valley</GamePath> <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files\GOG Galaxy\Games\Stardew Valley</GamePath> @@ -29,13 +37,6 @@ <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\GOG Galaxy\Games\Stardew Valley</GamePath> <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath> - <!-- registry paths --> - <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\GOG.com\Games\1453375253', 'PATH', null, RegistryView.Registry32))</GamePath> - <GamePath Condition="!Exists('$(GamePath)')">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 413150', 'InstallLocation', null, RegistryView.Registry64, RegistryView.Registry32))</GamePath> - - <!-- derive from Steam library path --> - <_SteamLibraryPath>$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Valve\Steam', 'SteamPath', null, RegistryView.Registry32))</_SteamLibraryPath> - <GamePath Condition="!Exists('$(GamePath)') AND '$(_SteamLibraryPath)' != ''">$(_SteamLibraryPath)\steamapps\common\Stardew Valley</GamePath> </PropertyGroup> </When> </Choose> |