I am trying to save the path of an application to a variable by using the registry.
What i want to achieve is:
1) Check if this application has an entry in the registry? (if it was installed or not)
2) If yes, I want to save the path to a variable which I can use later to use a program which is located in this path
So far i got
    public void Run1()
    {
        Console.WriteLine("Reading OCR path from registry");
        string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Tomcat\Common";
        string valueName = "OCR_path";
        string OCRPath = Microsoft.Win32.Registry.GetValue(keyName, valueName, null) as string;
        if (string.IsNullOrWhiteSpace(OCRPath))
        {
            string text = "3";
            System.IO.File.WriteAllText(@"C:\Users\Public\TestFolder\OCR-Toolkit-Check.txt", text);
        }
    }
 
     
    