1

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?

Community
  • 1
  • 1
user1026128
  • 23
  • 1
  • 4
  • What have you tried so far? http://www.google.com/#sclient=psy-ab&hl=en&site=&source=hp&q=c%23+check+if+program+is+installed&pbx=1&oq=c%23+check+if+program+is+installed&aq=f&aqi=g1&aql=&gs_sm=e&gs_upl=2041l6863l0l6975l32l19l0l8l8l0l300l3484l0.13.5.1l25l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=d6b7c50fe1987ca1&biw=1366&bih=655 – M.Babcock Dec 17 '11 at 15:29
  • 1
    Been asked a number of times. Please search next time http://stackoverflow.com/questions/908850/get-installed-applications-in-a-system – James Hull Dec 17 '11 at 15:31

2 Answers2

1

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) { ... }
fardjad
  • 20,031
  • 6
  • 53
  • 68
1

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.
}
Peter Ritchie
  • 35,463
  • 9
  • 80
  • 98