We are using WIX to install a number of services we create. I am writing a quick utility to dump the currently installed services. I just iterate over subkeys of:
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
looking for DisplayName
The problem is, only two of my ten services show up in the list.
However, when I look at the subkeys in regedit, they are there. As well, they are in installed programs (and I can find them in SELECT * from Win32_Product too).
I looked through the MSDN docs, trying to find out if there is some special "view" of the registry that I am missing. Maybe it is a privilege issue? But I am running the tool as admin. Is there some hive mounting issue?
Just to be clear with the code, here is the test app code (from this answer):
string registry_key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using(Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key))
{
foreach(string subkey_name in key.GetSubKeyNames())
{
using(RegistryKey subkey = key.OpenSubKey(subkey_name))
{
Console.WriteLine(subkey.GetValue("DisplayName"));
}
}
}
Any thoughts on this?