Monday, June 15, 2009

Checking to see Microsoft Report Viewer 2008 SP1 has been installed

We are updating the installer for one of our applications and that app now requires the Microsoft Report Viewer 2008 Service Pack 1 to be installed first.  The fun part is determining if it’s installed or not.  Usually, I check the registry keys to see if an application is installed.  If the user has installed the Report Viewer as a separate application, you’ll find it under the key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Report Viewer Redistributable 2008 SP1

If you want to read a value from that key, look for VersionMajor.  It should be a DWORD value of 1.

Of course that’s not the only way to get Report Viewer SP1 installed.  If you have Visual Studio 2008 and you have applied SP1, then you’ll have Report Viewer SP1 as part of the Service Pack.  Under that scenario, you wont have the “Microsoft Report Viewer Redistributable 2008 SP1” key. 

What you need to do is to check to see if VS 2008 SP1 is installed.  That key is located at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\InstalledProducts\KB945140

If you want to read a value for that key, look for string value for “PID”.

[Update on 6/16]

From the home office in Latham, NY, a reader sent in the suggested to also check the registry for 64 bit based machines.  On 64-bit editions of Windows, the Report Viewer Redistributable runs in 32-bit more.  It sees a virtualized version of the registry.  The actual registry location is

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Report Viewer Redistributable 2008 SP1

Note the “Wow6432Node”, that tells that it’s a 32 bit application installed on a 64 bit OS.

6 comments:

  1. I just installed the Report viewer SP1, and checked for these registry paths, but no use.
    Any ideas?
    ReplyDelete
  2. Ahmed,

    Under what OS did you install it under? Was it 32 or 64 bit. Was this a machine with VS2008 already installed or a clean machine?
    ReplyDelete
  3. Hi, I've installed the report viewer on a Windows Server 2003 64 bit server, but I am unable to find any reference to the report viewer package in the registry. I've searched the entire registry for "Microsoft Report Viewer" and the KB number with no luck. Any other suggestions would be greatly appreciated. Thanks.
    ReplyDelete
  4. Matt,

    I just checked one of my Server 2003 64-bit machines with regedit and it had the key for HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Report Viewer Redistributable 2008 SP1

    How did you install the Report Viewer Redistributable? Does it appear as it's own under Add/remove programs?
    ReplyDelete
  5. Chris, I think I found the source of my frustration. The developer who "installed" this did so by only copying over the assemblies rather than running through the installer. Hence, no registry keys or entries in Add/Remove Programs. Thanks for your assistance and sorry to send you on a goose chase.
    ReplyDelete
  6. Hello Matt,

    I want to programmatically check whether the reportviewer is installed. I'm using the registry key SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Microsoft Report Viewer Redistributable 2008 (KB971119)bcoz .. the last part of key Microsoft Report Viewer Redistributable 2008 SP1 didn't work for me...Is that (KB971119) specific to my system... Because I need to check for installation in many systems...
    ReplyDelete