{"record":{"id":"909af78fd816d6d6","repo":"gibbed/SteamAchievementManager","slug":"failed-to-get-steam-install-path","errorCode":null,"errorMessage":"failed to get Steam install path","messagePattern":"failed to get Steam install path","errorType":"exception","errorClass":"ClientInitializeException","httpStatus":null,"severity":"error","filePath":"SAM.API/Client.cs","lineNumber":49,"sourceCode":"    {\n        public Wrappers.SteamClient018 SteamClient;\n        public Wrappers.SteamUser012 SteamUser;\n        public Wrappers.SteamUserStats013 SteamUserStats;\n        public Wrappers.SteamUtils005 SteamUtils;\n        public Wrappers.SteamApps001 SteamApps001;\n        public Wrappers.SteamApps008 SteamApps008;\n\n        private bool _IsDisposed = false;\n        private int _Pipe;\n        private int _User;\n\n        private readonly List<ICallback> _Callbacks = new();\n\n        public void Initialize(long appId)\n        {\n            if (string.IsNullOrEmpty(Steam.GetInstallPath()) == true)\n            {\n                throw new ClientInitializeException(ClientInitializeFailure.GetInstallPath, \"failed to get Steam install path\");\n            }\n\n            if (appId != 0)\n            {\n                Environment.SetEnvironmentVariable(\"SteamAppId\", appId.ToString(CultureInfo.InvariantCulture));\n            }\n\n            if (Steam.Load() == false)\n            {\n                throw new ClientInitializeException(ClientInitializeFailure.Load, \"failed to load SteamClient\");\n            }\n\n            this.SteamClient = Steam.CreateInterface<Wrappers.SteamClient018>(\"SteamClient018\");\n            if (this.SteamClient == null)\n            {\n                throw new ClientInitializeException(ClientInitializeFailure.CreateSteamClient, \"failed to create ISteamClient018\");\n            }\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/gibbed/SteamAchievementManager/blob/de8b71048a0cee3c3e97cd8535e0f55ca86513e4/SAM.API/Client.cs#L31-L67","documentation":"Client.Initialize throws ClientInitializeException with failure code GetInstallPath when Steam.GetInstallPath() returns null/empty, meaning the native SteamPath lookup (registry on Windows) could not locate a Steam installation. The library needs the install path to find steam.dll/steam_api libraries before loading any interfaces. Initialization cannot proceed without it.","triggerScenarios":"Calling Client.Initialize(appId) on a machine where Steam is not installed, the registry key holding the Steam path is missing/corrupted, or Steam is installed in a non-standard location the lookup does not cover.","commonSituations":"Running the tool on a CI machine or server without Steam; a Steam install that was moved manually; corrupted Windows registry (HKCU\\Software\\Valve\\Steam missing SteamPath); running on Linux/macOS where the Windows registry lookup fails.","solutions":["Install Steam and run it at least once so the install-path registry key exists","Verify the Steam install path registry value (HKCU\\Software\\Valve\\Steam SteamPath on Windows) exists and points to a valid directory","Run the application on the same OS/architecture (x86/x64) the Steam registry was written for","If Steam is installed elsewhere, repair/reinstall Steam to restore the path value"],"exampleFix":"// before\nclient.Initialize(440); // throws if Steam path unknown\n// after\nif (string.IsNullOrEmpty(Steam.GetInstallPath()))\n{\n    Console.Error.WriteLine(\"Steam is not installed or its install path is not registered.\");\n    return 1;\n}\nclient.Initialize(440);","handlingStrategy":"try-catch","validationCode":"if (string.IsNullOrEmpty(SAM.API.Steam.GetInstallPath())) { /* Steam not installed: abort or prompt */ }","typeGuard":"static bool HasSteamInstall() => !string.IsNullOrEmpty(SAM.API.Steam.GetInstallPath());","tryCatchPattern":"try { client.Initialize(appId); }\ncatch (ClientInitializeException e) when (e.Failure == ClientInitializeFailure.GetInstallPath)\n{\n    // Steam not detected; show install instructions and exit\n}","preventionTips":["Run Steam at least once on the machine before using the library","Verify the Steam registry install path exists in deployment checks","Target the OS the Steam install was registered on (Windows registry lookup)"],"tags":["steam","initialization","native-interop"],"backgroundTag":"missing-env-var","analyzedSha":"de8b71048a0cee3c3e97cd8535e0f55ca86513e4","analyzedAt":"2026-09-12T09:05:06.619Z","contentChangedAt":"2026-09-12T09:05:06.619Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}