2

I am developing an installer. I need to check if Report Viewer is installed.

One key which I found online is,

var regKey = Microsoft.Win32.Registry.GetValue
(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server 2014 Redist\Microsoft Report Viewer 2015 Runtime\1033\Version", "Version", string.Empty);

didn't work.

Is there any other way to check if report viewer is installed on the client machine?

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164

1 Answers1

0

Bitness?: That component might be 32-bit? If so, perhaps try this registry location:

HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server 2014 Redist\Microsoft Report Viewer 2015 Runtime

Note the Wow6432Node sub-section above.

Instead of:

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server 2014 Redist\Microsoft Report Viewer 2015 Runtime

You can look in the MSI used to install the runtime to determine what exact keys and values are written.

Deployment Tool: I am not sure what tool you are using for deployment, but you should run the registributable MSI files for these components in sequence prior to your installation. Obviously. Commercial tools have support for this. WiX can do it via Burn, with less "auto-magic". Some tools details for you if you need it.


Note: I think the Microsoft System CLR Types for SQL Server 2014 (ENU\x64\SQLSysClrTypes.msi or ENU\x86\SQLSysClrTypes.msi or both - not sure) might be required for the installer for the Microsoft Report Viewer 2015 Runtime to work.


Files: I suppose you can also check for files that are installed. I have never done that for GAC files to be honest. Maybe worth a try.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • 1
    Thank you so much for mentioning me all the tools for installer, I am studying them as to which suits our application.Actually our application is .Net installer project which has a checklist kind of form which shows the installed and uninstalled components.We can install the components which are not yet installed.So in that list we have report viewer also which will be checked if its installed,If it is not then it will be installed by a button click.Bacisally trying to check the registration key for report viewer.I checked the other key,it is not working. – CuriousExtreme Jul 15 '18 at 06:39