Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
how to get install location of from registry in c#?
Sumit Kumawat
Dec 2 2017 9:28 AM
201
Reply
Hi all
i want to fetch install location of all products in my app so for that purpose i am using registry class and using below string value for it
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\UnInstall"
and
"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\UnInstall" for 64 bit version.
but it is not giving me details of all products for example
notepad ++ available in above path in registry editor but using my code it is not displaying the values for notepad.
below is my code
StreamWriter sw = new StreamWriter(@"D:\localmachineProducts64.txt", true);
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
foreach (string skName in rk.GetSubKeyNames())
{
using (RegistryKey sk = rk.OpenSubKey(skName))
{
try
{
sw.Write(sk.GetValue("DisplayName") + "\t" + sk.GetValue("InstallLocation"));
sw.Write(sw.NewLine);
count++;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
sw.Write("Total count :=" + count);
}
sw.Close();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to intregrate the Biomatrics Fingureprint with Asp.net ?
Start task service in c# using Task Scheduler .dll