Reputation: 23
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?
Upvotes: 1
Views: 973
Reputation: 35870
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.
}
Upvotes: 1
Reputation: 20404
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) { ... }
Upvotes: 1