in Source/RiderSourceCodeAccess/Private/RiderPathLocator/Win/RiderPathLocatorWin.cpp [152:188]
static TArray<FInstallInfo> CollectDotUltimatePathsFromRegistry( const Windows::HKEY RootKey, const FString& RegistryKey)
{
TArray<FInstallInfo> InstallInfos;
HKEY Key;
const LONG Result = RegOpenKeyEx(RootKey, *RegistryKey, 0, KEY_READ, &Key);
if (Result != ERROR_SUCCESS) return InstallInfos;
TArray<FString> Keys;
if (!EnumerateRegistryKeys(Key, Keys)) return InstallInfos;
for (const FString& key : Keys)
{
HKEY SubKey;
const LONG SubResult = RegOpenKeyEx(Key, *key, 0, KEY_READ, &SubKey);
if (SubResult != ERROR_SUCCESS) continue;
TArray<FString> Values;
if (!EnumerateRegistryValues(SubKey, Values)) continue;
for (const auto& Value : Values)
{
if (Value != TEXT("InstallDir")) continue;
FString InstallLocation;
if (GetStringRegKey(SubKey, Value, InstallLocation) != ERROR_SUCCESS) continue;
const FString ExePath = FPaths::Combine(InstallLocation, TEXT("bin"), TEXT("rider64.exe"));
TOptional<FInstallInfo> InstallInfo = FRiderPathLocator::GetInstallInfoFromRiderPath(ExePath, FInstallInfo::EInstallType::Installed);
if(InstallInfo.IsSet())
{
InstallInfos.Add(InstallInfo.GetValue());
}
}
}
return InstallInfos;
}