Andrew
Andrew

Reputation: 835

Determining an ActiveX control's version in Silverlight or Javascript

I am looking for a way to determine

a) whether or not a user has a specific ActiveX control installed, and

b) what the version of that control is in either Javascript or Silverlight.

I have used the following javascript code to determine the existence of the control:

        var activex;
        try {
            activex = new ActiveXObject('SomeProgId');
        } catch(e) {
            activex = null;
        }
        if (activex) {
            alert("found");
        } else {
            alert("not found");
        }

And that seems to work just fine.

But I see no way to access any version properties (or any properties at all) from that activex object.

I need to know what version the user has in order to determine if they need to be redirected to install a new version?

Any thought on the same are appreciated.

Upvotes: 1

Views: 140

Answers (1)

EricLaw
EricLaw

Reputation: 57085

As far as I know, there's no way to get the version information unless it's exposed as a property on the object's interface.

Having said that, you can solve this problem by including a version specifier after the #version= in the OBJECT tag's CODEBASE attribute. The object tag will prompt the user to upgrade the control if the version test isn't met.

See http://msdn.microsoft.com/en-us/library/941zhks9(v=vs.80).aspx for more details.

Upvotes: 1

Related Questions