{"record":{"id":"ebc2ec2cd3a55d5c","repo":"beeradmoore/dlss-swapper","slug":"gamepage-couldnotfindgameinstallpathtemplate","errorCode":null,"errorMessage":"GamePage_CouldNotFindGameInstallPathTemplate","messagePattern":"GamePage_CouldNotFindGameInstallPathTemplate","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/UserControls/GameControlModel.cs","lineNumber":263,"sourceCode":"                        _ = NVAPIHelper.Instance.DisplayNVAPIErrorAsync(gameControl.XamlRoot);\n                    }\n                }\n            }\n        }\n    }\n\n    [RelayCommand]\n    async Task OpenInstallPathAsync()\n    {\n        try\n        {\n            if (Directory.Exists(Game.InstallPath))\n            {\n                Process.Start(\"explorer.exe\", Game.InstallPath);\n            }\n            else\n            {\n                throw new Exception(ResourceHelper.GetFormattedResourceTemplate(\"GamePage_CouldNotFindGameInstallPathTemplate\", Game.InstallPath));\n            }\n        }\n        catch (Exception err)\n        {\n            Logger.Error(err);\n\n            if (gameControlWeakReference.TryGetTarget(out GameControl? gameControl))\n            {\n                var dialog = new EasyContentDialog(gameControl.XamlRoot)\n                {\n                    Title = ResourceHelper.GetString(\"General_Error\"),\n                    CloseButtonText = ResourceHelper.GetString(\"General_Okay\"),\n                    Content = err.Message,\n                };\n                await dialog.ShowAsync();\n            }\n        }\n    }","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/beeradmoore/dlss-swapper/blob/ab9b1e2d4bb04187c48fe58eeea06c2b0ea71fbb/src/UserControls/GameControlModel.cs#L245-L281","documentation":"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.","triggerScenarios":"Calling OpenInstallPathAsync when Directory.Exists(Game.InstallPath) is false — the game's recorded InstallPath no longer resolves (game uninstalled, moved, or path saved incorrectly).","commonSituations":"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.","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."],"exampleFix":"// before: stale InstallPath\nawait model.OpenInstallPathAsync(); // throws\n// after: guard before calling\nif (!Directory.Exists(Game.InstallPath))\n    await RescanGameInstallPathAsync(Game); // update stored path\nelse\n    await model.OpenInstallPathAsync();","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(Game.InstallPath) || !Directory.Exists(Game.InstallPath))\n    throw new DirectoryNotFoundException($\"Install path not found: {Game.InstallPath}\");","typeGuard":"static bool InstallPathExists(Game game) => !string.IsNullOrWhiteSpace(game.InstallPath) && Directory.Exists(game.InstallPath);","tryCatchPattern":"try { await control.OpenInstallPathAsync(); }\ncatch (Exception ex) when (ex.Message.Contains(\"CouldNotFindGameInstallPath\"))\n{ Logger.Error(ex); PromptRelocateGame(Game); }","preventionTips":["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."],"tags":["file-system","path","game-install","not-found"],"backgroundTag":"file-not-found","analyzedSha":"ab9b1e2d4bb04187c48fe58eeea06c2b0ea71fbb","analyzedAt":"2026-09-15T05:25:32.979Z","contentChangedAt":"2026-09-15T05:25:32.979Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}