beeradmoore/dlss-swapper · error · Exception
Could not detect ubisoftConnectInstallsKey.
Error message
Could not detect ubisoftConnectInstallsKey.
What it means
UbisoftConnectLibrary.ListGamesAsync opens the HKLM registry key SOFTWARE\Ubisoft\Launcher\Installs to enumerate Ubisoft Connect game installs. If that key cannot be opened (returns null), Ubisoft Connect is not installed (or the launcher has never run), so the method throws instead of returning an empty list. It is a hard prerequisite failure: without install metadata no games can be detected.
Solutions
- Install and launch Ubisoft Connect at least once so it writes HKLM\SOFTWARE\Ubisoft\Launcher\Installs, then retry.
- Check the registry manually (reg query "HKLM\SOFTWARE\Ubisoft\Launcher\Installs"); if the key is only under Wow6432Node, open it with RegistryView.Registry32/64 explicitly.
- Treat the exception as 'Ubisoft not installed' upstream and skip the Ubisoft provider instead of failing the whole scan.
- Verify the process has permission to read HKLM (standard users can read, but restrictive policies can block it).
Example fix
// before
using (var ubisoftConnectInstallsKey = hklm.OpenSubKey(@"SOFTWARE\Ubisoft\Launcher\Installs"))
{
if (ubisoftConnectInstallsKey is null)
throw new Exception("Could not detect ubisoftConnectInstallsKey.");
// after
using (var hklm64 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
using (var ubisoftConnectInstallsKey = hklm64.OpenSubKey(@"SOFTWARE\Ubisoft\Launcher\Installs"))
{
if (ubisoftConnectInstallsKey is null)
return Enumerable.Empty<Game>(); // Ubisoft Connect simply not installed
Defensive patterns
Strategy: validation
Validate before calling
using var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Default);
using var k32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
bool ubisoftInstalled = hklm.OpenSubKey(@"SOFTWARE\Ubisoft\Launcher\Installs") != null
|| k32.OpenSubKey(@"SOFTWARE\Ubisoft\Launcher\Installs") != null;
if (!ubisoftInstalled) { /* skip Ubisoft provider */ } Type guard
static bool HasUbisoftInstallsKey()
{
using var k = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Ubisoft\Launcher\Installs");
return k != null;
} Try / catch
try
{
var games = await library.ListGamesAsync();
}
catch (Exception ex) when (ex.Message.Contains("ubisoftConnectInstallsKey"))
{
Logger.Info("Ubisoft Connect not installed; skipping.");
} Prevention
- Pre-check the registry key (both 32/64-bit views) before enumerating games.
- Treat absence of a launcher's registry key as an expected 'not installed' state, not an exception.
- Always launch-scan in a try/catch per provider so one missing launcher does not abort the whole scan.
When it happens
Trigger: Calling ListGamesAsync on a machine where HKLM\SOFTWARE\Ubisoft\Launcher\Installs does not exist — Ubisoft Connect not installed, never launched, or running a legacy launcher version with a different registry layout. Also occurs under 32/64-bit registry view mismatch (the app not reading the WOW6432Node view where the key actually lives).
Common situations: Running the library on a clean machine or CI agent without Ubisoft Connect; portable/partial Ubisoft installs that never wrote the Installs key; scanning from a 32-bit process where the key is under Wow6432Node; corporate machines where HKLM write/read views are restricted.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
AI-assisted analysis of beeradmoore/dlss-swapper@ab9b1e2d4b (2026-09-15).
Data as JSON: /api/errors/7f11f46f95961cb1.
Report an issue: GitHub.
Appendix: source
Thrown at src/Data/UbisoftConnect/UbisoftConnectLibrary.cs:81
}
var cachedGames = GameManager.Instance.GetGames<UbisoftConnectGame>();
// Gat a list of installed games.
// NOTE: Some games are installed from Ubisoft Connect via Steam (eg. Far Cry: Blood Dragon)
// Those titles will show up in the Steam games list.
// Ironically Ubisoft Connect may show double gamess listed here if you do indeed own it from uplay/ubisoft connect and from 3rd party stores.
var installedTitles = new Dictionary<int, UbisoftGameRegistryRecord>();
try
{
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
{
using (var ubisoftConnectInstallsKey = hklm.OpenSubKey(@"SOFTWARE\Ubisoft\Launcher\Installs"))
{
// if ubisoftConnectRegistryKey is null then Ubisoft is not installed .
if (ubisoftConnectInstallsKey is null)
{
throw new Exception("Could not detect ubisoftConnectInstallsKey.");
}
var subKeyNames = ubisoftConnectInstallsKey.GetSubKeyNames();
foreach (var subKeyName in subKeyNames)
{
// Only use the subKeyName that is a number (which is the installId.
if (Int32.TryParse(subKeyName, out var installId))
{
using (var ubisoftConnectInstallDirKey = ubisoftConnectInstallsKey.OpenSubKey(subKeyName))
{
if (ubisoftConnectInstallDirKey is null)
{
break;
}
var gameInstallDir = ubisoftConnectInstallDirKey.GetValue("InstallDir") as string;
if (string.IsNullOrEmpty(gameInstallDir) == false)
{View on GitHub (pinned to ab9b1e2d4b)