Automatically download plug-ins or programs from the client

Source: Internet
Author: User

Cause:
Many website designers want to automatically install a plug-in orProgramTo achieve various special effects.

Solution:
This automatic download function is an Active X-based method provided by Internet Explorer 5.x or later. The IE browser checks whether the software is installed in the current system by using the software name and version marked by the <Object> label on the webpage. If the software is installed, it checks whether the version is older than the software version, when the current system does not have the software or the version is not enough, ie will automatically install the software. Of course, before installing the software, it will have a security authentication process.

Steps:

1. Select a file
The plug-in program to be installed must contain multiple files, which can be an executable file of .exe or. ocx or. dll. First, we need to prepare the file to be installed. It is best to store it in the same directory for further preparation. I have selected a file for demonstration, test. dll, to be installed in the current Windows System directory.

2. Create a. inf file.
The. inf file is the installation configuration file. It specifies the files to be installed in the software package and the target directories to be installed, the program group to be created, and the Registry content to be modified. Most of the installation programs contain such files.
Common. INF files are generally divided into several sections. See table 1
[Version] used to confirm the basic version information of the. inf file
[Defainstall install] This section is executed by default. Contains pointers to other sections. This section can be used to specify the files to be copied and deleted, registry updates, and. inf file updates.
[Destinationdirs] specifies the location (for example, \ windows or WINDOWS \ SYSTEM) for copying, deleting, or renaming a node file on the hard disk ).
[Filecopy/delete/renamesection (s)] lists the files to be copied, deleted, or renamed.
[Strings] lists the localized strings used above.

Table 1

Note that the destination folder "destinationdirs" is used. We generally use the Logical Disk identifier (ldid), of which 25 indicates the system directory. For more information, see table 2.
00 null ldid-used to create a new ldid
01 source drive: \ pathname
10 machine folder (Map to Windows Folder during server-based installation)
11 system folder
12 iosubsys folder
13 command folder
17 inffolder
18. Help folder
20 Fonts
21 viewers
22 vmm32
23. Color folder
24. root directory of the drive containing the Windows folder
25 Windows Folder
26 windows-defined boot device (winboot)
28 host winboo
30. root folder of the boot disk
31. root folder of the master drive of the virtual boot disk

Table 2

3. Create a software package
To release the plug-in or software on the web page, you must make it a. Cab compression package for Windows. The iexpress tool used to create the software package is provided in High-version windows. If the Windows version is not high enough, you can find ieak5.exe or ieak5cd. EXE in the ie5 installer and execute this file.
Run the iexpress program and select create compressed files only (Active instils) to create the. cab file. Next, we will name the software package as a test. cab file. Then, select the test. dll and test. INF files for packaging.

4. Digital Signature
Although we have prepared a software package, if you do not need an electronic certificate to sign it, it cannot pass the client's security check (unless the security level is set to "low "). You can use signcode.exe, download/signcode.exe.

5. Publish the software package on the webpage
Our ultimate goal is, of course, to publish the software or plug-in on the web page. The HTML elements to be used are: <Object> </Object>

First, we will introduce the attributes involved in our operations as follows:
CLSID: the number of the generated class in windows, which involves some Windows Registry knowledge. This article will not go into detail.
Codebase: Specifies the address and version of the software to be downloaded.
For example, we can write data in a webpage:

<Object classid = "CLSID: A27CDB6E-AE6D-11CF-96B8-444553540000" codebase = "test. Cab # version =," viewastext>
</Object>

If you do not know the version of your software, you can write version =-1,-1,-1,-1, in this way, the client can be downloaded without the software, and ignored if the software is downloaded.
Finally, we need to experience our own achievements.

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.