How to make a cab package when downloading controls from a Web page

Source: Internet
Author: User
Tags contains ini
Controls | Web page | download | Download control the INTERNET software distribution Unit is a package that consists of a CAB file (. cab) that contains an. inf file or a software distribution (. osd) file (or both). A distribution unit can also contain software components, such as ActiveX controls (. ocx),. dll files,. exe files, Java class files, or applets. When the CODEBASE attribute of an OBJECT element on a Web page references a CAB file that contains an. inf file, the Internet Explorer 3.0 and later versions automatically use the CAB file as the software distribution unit.
First step: Create an INF file:
INF file is a text file that specifies the files (such as DLLs or other OCX) that need to be downloaded or submitted to run the control.
An INF file bundles all the necessary files for the cab cabinet file. By default,
Files with the same file version number on an existing hard disk are not downloaded.
To learn more about the INF file and its options, including how to create a platform-independent INF file,
Refer to the setup and System management services for the Platform Software Development Kit (Platform SDK) (Setup and Systems Management service)
Part of the \setup api\overview\inf the contents of the Files directory.
Here's an example of a videoweb.dll I wrote myself. Used in Videoweb.dll: Tdiio.dll,encoder.dll,decoder.dll,tdiio.ini,user.ini,
Camer.ini,drivo.ini.
Examples of Video.inf:
; INF file for Videoweb.dll
[Version]
Signature= $CHICAGO $

[DestinationDirs]
dllsyscopy=11
Iniwincopy=25

[DefaultInstall]
Copyfiles=dllsyscopy,iniwincopy
Addreg=videoreg

[Dllsyscopy]
Tdiio.dll
Decoder.dll
VideoWeb.dll

[Iniwincopy]
Camer.ini
User.ini
Xvidmp4.ini

[Videoreg]
HKCR,CLSID\{4BDA0AA3-2164-44B7-8A88-208A145F51DC}, "",%reg_sz%, "video Class"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\control
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\implemented Categories
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\implemented CATEGORIES\{7DD95801-9882-11CF-9FA9-00AA006C42C4}
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\implemented CATEGORIES\{7DD95802-9882-11CF-9FA9-00AA006C42C4}
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\inprocserver32, "",%reg_sz%, "%11%\videoweb.dll"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\inprocserver32, "ThreadingModel",%REG-SZ%, "Apartment"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\miscstatus, "",%reg_sz%, "0"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\miscstatus\1, "",%reg_sz%, "131473"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\progid, "",%reg_sz%, "videoweb.1.1"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\programmable
HKCR,CLSID\{4BDA0AA3-2164-44B7-8A88-208A145F51DC}\TOOLBOXBITMAP32, "",%reg_sz%, "%11%\videoweb.dll,102"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\typelib, "",%reg_sz%, "{fc4352cb-bb55-498c-bb21-e4bae2fc2584}"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\version, "",%reg_sz%, "1.0"
Hkcr,clsid\{4bda0aa3-2164-44b7-8a88-208a145f51dc}\versionindependentprogid, "",%reg_sz%, "VideoWeb.1"
; End of INF file

DestinationDirs: Refers to the loading directory or file address: 11 designated as the system directory Windows/system or Winnt/system32;
10 is the window directory, Windows, or Winnt.
Videoreg: If you write your own control: You can first register with regsvr32 xxx.dll, and then locate the registration information from the registry.
Of course, this is just a simple INF file for distributing software over the Internet, and a more complex INF file. Please look at the SDK.

Step two: Put Video.inf, Tdiio.dll,encoder.dll,decoder.dll,tdiio.ini,user.ini,
Camer.ini,drivo.ini. Put it in a folder.
Step three: Start making the CAB file, which I made with the IExpress tool (the tool is under the Winnt\System32 directory).
1: Select Create a new self-extracting directive file.
2: Choose to create only compressed files (ActiveX installation)
3: Click Add to add the files you want for others to download
4: Click to browse input *.cab file address (including file name)
5: Whatever.
All right, finish the production.
Now use the control on your Web page, and when someone accesses your page, the browser automatically downloads the installation if it doesn't have your control on it. Because your control may not have been signed.
So you have to reduce the security level of your browser in your browser. Select Security in the Internet Tools, and choose Custom. Locate the unsigned ActiveX control to download. Select the prompt below it or enable it.
Insert in Web page:
<object CLASSID=CLSID:4BDA0AA3-2164-44B7-8A88-208A145F51DC
Codebase= "video.cab#version=2,0,0,1"
Id=video1 style= "HEIGHT:507PX; width:718px "></OBJECT>
The sentence.
Note: You have to put the *.cab file you and the Web page in the same directory. or specify the path of the *.cab in codebase.




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.