1. If you need to create a CAB file, you first need Cabarc or makecab, and they have the installation of the Cabinet SDK, the download address of the Cabinet SDK is http://msdn.microsoft.com/Workshop/Management/cab/cabdl.asp .
Cabarc can create, view, or solve files in the CAB, while Makecab can only be used to create a CAB file.
2. When making a CAB file, you need to include all related files, and you can check the required files via Depends (VC itself). Write these things in using the INF file.
3, INF Functions: INF file describes all OCX and DLL files in the CAB, INF provides information required by some naming areas.
How to write INF
The most beginning is generally [Version] area:
EG: [Version]
Signature = "$ xxxx $"
Advancedinf = 2.0
Next is the most important [Add.code] area:
EG: [add.code]
Ctrl1.dll = c1section
Ctrl2.dll = ctrl2.dll
The front is the name of the file to download, followed by the area name corresponding to this file, can be any name, but generally the same name as the file, so convenient maintenance. It is also necessary to note that the files appearing in the [Add.code] area should be sorted according to the dependencies, such as the previous Ctrl1.dll depends on Ctrl2.dll, then Ctrl2.dll appears in front of Ctrl1.dll. Because the installation is in the reverse order, that is, install Ctrl2.dll first, then Ctrl1.dll, 哧哧, clear, don't negotiate.
Next, it is the area of each file.
[Ctrl1.dll]
FILE-WIN32-X86 = thiscab
RegisterServer = YES
CLSID = {.....}
Destdir =
Fileversion = 1, 0, 0, 0
[Ctrl1.dll] The first file value in the area tells the IE where to get this DLL, File includes three parts, the first part is file, this is always like this (at least, the second part) Tell the statement that the supported OS, Win32 means Windows, Mac is Apple Mac OX; the third part is the CPU type, such as x86, PPC (Power PC), MIPS or Alpha.
File's value can take three URLs, Ignore and thiscab, if it is URL, the location where the URL is located; if it is an Ignore description For this OS and CPU, do not need to download this file (ctrl1.dll); if It is thiscab very obviously in the current CAB file.
Next, it is REGISTERSERVER, you can take two values, Yes and NO. If you are yes, the IE is to register the DLL, if it is NO;
Then DESTDIR, its value is the location where the DLL will save to the local hard disk, if its value is 10, put the DLL in / windows or / winnt; if it is 11, put it in / windows / system or
/ Winnt / System 32; if it is empty (that is no value), it will be placed in the Downloaded Program files directory under / windows or / winnt;
Finally, FileVersion, this is more obvious, indicating the version number of Ctrl1.dll. Sometimes we use VB to develop controls, you need to put the VB's virtual machine, it requires some other instructions, simply talk about it:
Add a MSVBVM60.dll = msvbvm60.dll = msvbvm60.dll = msvbvm60.dll below is below
MSVBVM60.DLL area:
[Msvbvm60.dll]
Hook = MSVBVM60.CAB_INSTALLER
Fileversion = 6, 0, 81, 76
Fileversion is obvious, it is the version number, no longer say, talk about hook.
The hook area is the area that needs to be executed during installation. It is divided into two, one is conditional, and the other is unconditional, unconditional HOOK area must be executed, and vice versa, it is determined whether or not it is executed according to the condition. The area marked with [setup hooks] is unconditional area, as shown below
[Setup hooks]
Hookname = section- name
[section-name]
Run =% extract_dir% / setup.exe
The unconditional area is often used to perform a installer via an INF file, which is why we perform such a menu when the resource manager is right-clicking on an INF file.
When IE downloads a CAB file, if there is no [add.code] in the file, the [setup hooks] area is processed, running RUN specifies the program, 哧哧, the above is setup.exe;
The conditional area is performed under certain conditions, the HOOK area specified in front of MSVBVM60.dll is a conditional area, if the CLSID or Version specified in MSVBVM60.dll does not meet the needs and does not meet this named value, execute the hook specified by the Hook. area.
[Msvbvm60.cab_installer]
File-win32-x86 = http: //activex.microsoft.com/controls/vb6/vbrun60.cab
Run =% extract_dir% / vbrun60.exe
The above [msvbvm60.cab_installer] is an HOOK area, which also contains a file value, specifies a URL, indicating that MSVBVM60.dll can be downloaded from this URL; RUN means which file
It is necessary to explain this here that MS is some commonly used Redistributable Microsoft DLLS
You can use these files in the CAB file, which needs to include these files in the CAB file, and the DLL above the computer is Redistributable Microsoft DLLS on the computer.
Create a CAB file:
Cabarc n ctrl1.cab ctrl1.inf ctrl1.dll
N means that you want to create a new file, ctrl1.cab is the created file name, ctrl1.inf is the CAB INF, but it is necessary to add files in the CAB, you can use wildcard.
Then you can put the CAB file on the webpage.