Seeing if user has Adobe Flash Player installed?

974 views Asked by At

Possible Duplicate:
How can I make my application check if Adobe flash player is installed on a PC?

I need to make sure that the user has the latest flash player for internet explorer installed upon startup of the program, does anyone know how I can check for this?

2

There are 2 answers

0
fardjad On BEST ANSWER

using WMI:

var query = new ManagementObjectSearcher("SELECT * FROM Win32_Product");
var res = from ManagementObject m in query.Get() where m.Properties["Name"].Value.ToString() == "Flash Player"; // I don't know the name of flash player installer
if (res.Count > 0) { ... }
0
Peter Ritchie On

Another way is to check the file association for SWF files. That will point to a identifier that tells you the version of Flash like "ShockwaveFlash.ShockwaveFlash.10". For example:

var subKey = Registry.ClassesRoot.OpenSubKey(@"ShockwaveFlash.ShockwaveFlash\CurVer");
if (subKey != null) 
{
    var value = subKey.GetValue(null) as String;
    // TODO: parse the number after the last period in the string.
}