Implement the ActiveX automatic upgrade function running in the browser

Source: Internet
Author: User

Implement the ActiveX automatic upgrade function running in the browser

Http://blog.csdn.net/wqf2)

At present, some of our company's application products have B/S needs, and ActiveX has become the most convenient bridge for us to transition from C/S to B/S. The biggest advantage of B/S is that you do not need to run and install the client. Program , Which is easy to deploy. In our traditional C/S client program, the automatic upgrade function adopts the following mode: the server runs an automatic upgrade service program, and the client connects to the service based on the version judgment to download and upgrade. In the B/S structure, upgrading an ActiveX control also adopts this mode.
I would like to talk about how to implement my ActiveX automatic upgrade function.
First, compress ActiveX controls and dependent files into a cab package. The tool I used is the cab tool in Visual Studio. NET 2003. An osd xml file is added to the generated cab package. This file describes the package name, package version, and component information. The version of the package is a comparison condition for future upgrades. Before generating a package, we can use Visual Studio. NET 2003 to set this version.
Then, compile the HTML file that calls ActiveX and call it as follows:
<Object classid = "CLSID: 4b9759dd-5550-40bb-a932-e51ae6e51818" codebase = "http://www.yournet.com/test.CAB#version=1,0,0,0">
</Object>
Classid is the CLSID of the component. Codebase is the version of ActiveX component and cab package.
When the browser browses this webpage, it will first determine whether this ActiveX exists on the local machine. If not, it will go to the terminal. In this way, you can implement automatic upgrade without writing or rewriting any program. When a new version of ActiveX is available, you can create a new cab package, add the cab version, and change it to the corresponding version of codebase.
Problem: the CAB files downloaded from the website will be saved to the "Downloaded Program Files" folder in the Windows directory of the Local Computer. If your cab package has been updated many times, the old ocx file is not overwritten, but exists in the cab package. That is to say, There will be various versions of ActiveX on your machine, which ensures compatibility effectively.

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.