If Javascript is used to check whether a software has been installed, a download error is prompted.

Source: Internet
Author: User

Check whether a user has installed a software.

I. materials:

Function ocxstatus (){

VaR newobj;

Try {

Newobj = new activexobject ("tvantsx. tvantsxctrl.1 ");

If (typeof newobj! = 'Undefined '){

Newobj = NULL;

Return true;

}

} Catch (e ){

Newobj = NULL;

Return false;

}

}

Ii. Problems:

The yellow background section above looks like a component name. The problem that cannot be solved now is that you do not know the component names of each player. Currently, you only know CLSID !!!

 

Iii. Problem Solving:

I found a lot of information online, many of which need to know clsid. After hard searching, I finally found this code in a certain corner of a Website:

ActiveX JS can be used to call ActiveX
Page
<Object style = 'display: none ;'
Id = 'byd _ ICC 'name = 'byd _ ICC' classid = 'clsid: 4e0841cc-655f-4355-adeb-484a443fe3a7'
Codebase = 'byd _ ICCR. Cab # version =, '> </Object>

Adding ActiveX objects to the body

JS call
VaR tempcardid =
Byd_icc.getcardidbyhex (); // call actiex

If (tempcardid! = ""){

This. trreadcard. stopall ();
This. loginuser (tempcardid );

Byd_icc.clearcardid ();
Previouscardid = "";
}

This method can solve the problem by knowing the classid !!! However, after testing, the above Code is purely flawed and cannot be implemented. M's deception of my feelings.

It seems that you only have to rely on yourself.

Since classid cannot be used in code to detect whether a software is installed, why not try to see what the so-called "component name" is?

I first thought of the installation file, so I found it in the installation file and finally found it.Powerlist. ocx Install the ActiveX control in the directory. At this time, I really like it, and she is the only one. However, the tragedy is that the so-called component name is not it !!!............... After a while, I thought, sinceYesClassid and classid are in the Registry again. Why don't I try to start with the Registry !!! So I searched for the classid corresponding to the software under the CLSID directory of the Registry and finally found something called proid very familiar,The so-called component name is proid, and the registry can be queried. The following problem is easily solved. Even if you do not know the classid, be patient and find the so-called "component name" of the software in the registry, that is, proid.

 

 

 

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.