I need to replace the file which is installed in any drive like C,D,E... I want to find the installed file path from registry and replace this file to other file. software will be installed in any drive. I want to replace file.
I am using this code.
how to find the installed file path and replace to other file in C# using registry.
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"));
if (subkey.GetValue("DisplayName") == "ActiveTeach Images Book 3")
{
}
}
}
}