gibbed/SteamAchievementManager · error · ClientInitializeException

failed to get Steam install path

Error message

failed to get Steam install path

What it means

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.

Solutions

  1. Install Steam and run it at least once so the install-path registry key exists
  2. Verify the Steam install path registry value (HKCU\Software\Valve\Steam SteamPath on Windows) exists and points to a valid directory
  3. Run the application on the same OS/architecture (x86/x64) the Steam registry was written for
  4. If Steam is installed elsewhere, repair/reinstall Steam to restore the path value

Example fix

// before
client.Initialize(440); // throws if Steam path unknown
// after
if (string.IsNullOrEmpty(Steam.GetInstallPath()))
{
    Console.Error.WriteLine("Steam is not installed or its install path is not registered.");
    return 1;
}
client.Initialize(440);
Defensive patterns

Strategy: try-catch

Validate before calling

if (string.IsNullOrEmpty(SAM.API.Steam.GetInstallPath())) { /* Steam not installed: abort or prompt */ }

Type guard

static bool HasSteamInstall() => !string.IsNullOrEmpty(SAM.API.Steam.GetInstallPath());

Try / catch

try { client.Initialize(appId); }
catch (ClientInitializeException e) when (e.Failure == ClientInitializeFailure.GetInstallPath)
{
    // Steam not detected; show install instructions and exit
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of gibbed/SteamAchievementManager@de8b71048a (2026-09-12). Data as JSON: /api/errors/909af78fd816d6d6. Report an issue: GitHub.

Appendix: source

Thrown at SAM.API/Client.cs:49

    {
        public Wrappers.SteamClient018 SteamClient;
        public Wrappers.SteamUser012 SteamUser;
        public Wrappers.SteamUserStats013 SteamUserStats;
        public Wrappers.SteamUtils005 SteamUtils;
        public Wrappers.SteamApps001 SteamApps001;
        public Wrappers.SteamApps008 SteamApps008;

        private bool _IsDisposed = false;
        private int _Pipe;
        private int _User;

        private readonly List<ICallback> _Callbacks = new();

        public void Initialize(long appId)
        {
            if (string.IsNullOrEmpty(Steam.GetInstallPath()) == true)
            {
                throw new ClientInitializeException(ClientInitializeFailure.GetInstallPath, "failed to get Steam install path");
            }

            if (appId != 0)
            {
                Environment.SetEnvironmentVariable("SteamAppId", appId.ToString(CultureInfo.InvariantCulture));
            }

            if (Steam.Load() == false)
            {
                throw new ClientInitializeException(ClientInitializeFailure.Load, "failed to load SteamClient");
            }

            this.SteamClient = Steam.CreateInterface<Wrappers.SteamClient018>("SteamClient018");
            if (this.SteamClient == null)
            {
                throw new ClientInitializeException(ClientInitializeFailure.CreateSteamClient, "failed to create ISteamClient018");
            }

View on GitHub (pinned to de8b71048a)