How to create verification that will validate if Reportviewer is installed?

Asked

Viewed 60 times

4

I need to create a check that will validate the installation of Report Viewer on the user’s machine. If 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 any results.

Can anyone tell me how I can create this check, or has some content to indicate where I can consult?

  • Is it ASP.NET or is it Winforms? Don’t use technology tags that you’re not using.

  • @jbueno is Winforms in the case.

1 answer

3


You can check in the register:

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;
}
  • Denis, I will implement the available code and see what results returns.

  • 1

    I implemented the code and ran the test, and it is returning false. In this case there is no Reportviewer installed correct ? I realized that the version of my Framework is different from the one in the code, it interferes with the verification ?

  • 1

    Denis, I managed to solve it worked. Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.