How to create verification that will validate if the ReportViewer is installed?

4

I need to create a check that will validate the Report Viewer installation on the user machine. If it is not installed, I need to receive this information to make a treatment present a message to the user and facilitate future maintenance.

I'm doing a lot of research, but I'm not getting results.

Does anyone know how to create this check, or do you have some content to indicate where to look?

    
asked by anonymous 17.04.2017 / 18:00

1 answer

3

You can check the registry:

public bool IsInstalled()
{
    RegistryKey registryBase = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, string.Empty);
    if (registryBase != null)
    {
        return registryBase.OpenSubKey(@"Software\Microsoft\ReportViewer\v2.0.50727") != null
            || registryBase.OpenSubKey(@"Software\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\ReportViewer v10") != null
            || registryBase.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\ReportViewer\v10.0") != null;
    }
        return false;
}
    
17.04.2017 / 18:06