-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Windows Store build (#417)
- Loading branch information
Showing
6 changed files
with
67 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using Microsoft.Win32; | ||
using OWML.Common; | ||
|
||
namespace OWML.GameFinder | ||
{ | ||
public class UWPGameFinder : BaseFinder | ||
{ | ||
private const string RegistryPath = @"Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages"; | ||
|
||
public UWPGameFinder(IOwmlConfig config, IModConsole writer) | ||
: base(config, writer) | ||
{ | ||
} | ||
|
||
public override string FindGamePath() | ||
{ | ||
var appPackages = Registry.CurrentUser.OpenSubKey(RegistryPath); | ||
|
||
var gamePath = ""; | ||
foreach(var appPackageName in appPackages?.GetSubKeyNames()) | ||
{ | ||
var appPackageKey = appPackages.OpenSubKey(appPackageName); | ||
var packageDisplayName = (string)appPackageKey.GetValue("DisplayName"); | ||
|
||
if(!String.IsNullOrEmpty(packageDisplayName) && packageDisplayName.Contains("Outer Wilds")) | ||
{ | ||
gamePath = (string)appPackageKey.GetValue("PackageRootFolder"); | ||
break; | ||
} | ||
} | ||
|
||
if (IsValidGamePath(gamePath)) | ||
{ | ||
return gamePath; | ||
} | ||
|
||
Writer.WriteLine("Game not found in UWP."); | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters