beeradmoore/dlss-swapper · error · Exception
GamePage_CouldNotFindGameInstallPathTemplate
Error message
GamePage_CouldNotFindGameInstallPathTemplate
What it means
GameControlModel.OpenInstallPathAsync opens the game's install directory in Windows Explorer; when Game.InstallPath does not exist on disk it throws a localized 'could not find game install path' exception formatted with the stored path. It indicates the recorded install location is stale or wrong.
Solutions
- Verify the game is installed and locate its current folder, then update the game's InstallPath entry.
- Re-detect/re-import the game so its install path is refreshed automatically.
- Reconnect the missing drive or restore the folder if it was on external/cloud storage.
- Manually correct InstallPath in the game's settings/library entry.
Example fix
// before: stale InstallPath
await model.OpenInstallPathAsync(); // throws
// after: guard before calling
if (!Directory.Exists(Game.InstallPath))
await RescanGameInstallPathAsync(Game); // update stored path
else
await model.OpenInstallPathAsync(); Defensive patterns
Strategy: validation
Validate before calling
if (string.IsNullOrWhiteSpace(Game.InstallPath) || !Directory.Exists(Game.InstallPath))
throw new DirectoryNotFoundException($"Install path not found: {Game.InstallPath}"); Type guard
static bool InstallPathExists(Game game) => !string.IsNullOrWhiteSpace(game.InstallPath) && Directory.Exists(game.InstallPath);
Try / catch
try { await control.OpenInstallPathAsync(); }
catch (Exception ex) when (ex.Message.Contains("CouldNotFindGameInstallPath"))
{ Logger.Error(ex); PromptRelocateGame(Game); } Prevention
- Re-scan game install paths when a game launcher library is moved.
- Detect uninstalled games and update or gray out their library entries.
- Store install paths as absolute and verify at app startup.
- Handle drive-letter changes from external drives before opening paths.
When it happens
Trigger: Calling OpenInstallPathAsync when Directory.Exists(Game.InstallPath) is false — the game's recorded InstallPath no longer resolves (game uninstalled, moved, or path saved incorrectly).
Common situations: Game uninstalled or moved to another drive after being added; Steam/Epic library relocated; path points to a non-connected external drive; game added before installation completed.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
AI-assisted analysis of beeradmoore/dlss-swapper@ab9b1e2d4b (2026-09-15).
Data as JSON: /api/errors/ebc2ec2cd3a55d5c.
Report an issue: GitHub.
Appendix: source
Thrown at src/UserControls/GameControlModel.cs:263
_ = NVAPIHelper.Instance.DisplayNVAPIErrorAsync(gameControl.XamlRoot);
}
}
}
}
}
[RelayCommand]
async Task OpenInstallPathAsync()
{
try
{
if (Directory.Exists(Game.InstallPath))
{
Process.Start("explorer.exe", Game.InstallPath);
}
else
{
throw new Exception(ResourceHelper.GetFormattedResourceTemplate("GamePage_CouldNotFindGameInstallPathTemplate", Game.InstallPath));
}
}
catch (Exception err)
{
Logger.Error(err);
if (gameControlWeakReference.TryGetTarget(out GameControl? gameControl))
{
var dialog = new EasyContentDialog(gameControl.XamlRoot)
{
Title = ResourceHelper.GetString("General_Error"),
CloseButtonText = ResourceHelper.GetString("General_Okay"),
Content = err.Message,
};
await dialog.ShowAsync();
}
}
}View on GitHub (pinned to ab9b1e2d4b)