Finding Silverlight version & Installation Folder programmatically

el_shayan picture el_shayan · Jan 27, 2011 · Viewed 9.4k times · Source

Is it possible to find the version of the installed Silverlight (e.x. 4.0.51204.0) and its installation folder (e.x. C:\Program Files (x86)\Microsoft Silverlight\4.0.51204.0) in a C# program?

Some notes:

  1. Not within a Silverlight application, but from somewhere else (for example in a console application)
  2. This is NOT such a thing as HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight in my machine.

Answer

Flavio picture Flavio · Jan 27, 2011

There should be a key in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Silverlight\Version

The installation folder should always be:

%ProgramFiles%\Microsoft Silverlight

You could also read the version number from the files in this directory (sllauncher.exe for example).