I want to check from my code if a particular version of flash player is installed or not. I used the following code
using Microsoft.Win32
RegistryKey RK = R
Adobe's old (pre 10) IE Flash detection code used to test in VBScript if it could instantiate object ShockwaveFlash.ShockwaveFlash.<major version>. If it's just the major version you want to test, you can check for those keys under HKCR, e.g. HKEY_CLASSES_ROOT\ShockwaveFlash.ShockwaveFlash.10
.
SWFObject instantiates the version-less object name, ShockwaveFlash.ShockwaveFlash, and queries its $version
property. To do this in C#:
// Look up flash object type from registry
var type = Type.GetTypeFromProgID("ShockwaveFlash.ShockwaveFlash");
if (type == null)
{
// No flash
return;
}
// Create a flash object to query
// (should probably try/catch around CreateInstance)
var flashObject = Activator.CreateInstance(type);
var versionString = flashObject.GetType()
.InvokeMember("GetVariable", BindingFlags.InvokeMethod,
null, flashObject, new object[] {"$version"})
as string;
// e.g. "WIN 10,2,152,26"
// Clean up allocated COM Object
Marshal.ReleaseComObject(flashObject);