Search code examples
c#silverlightregistryprogram-files

Finding Silverlight version & Installation Folder programmatically


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.

Solution

  • 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).