Cabarc can create, view or solve the files in the cab, while Makecab can only be used to create cab files.
2. When making a cab file, all relevant files need to be included. You can check the required files through Depends(VC (which comes with VC). Use inf file to write all these things in.
3. inf method: inf file describes all ocx and dll files in cab, and inf provides needed information through some named areas.
how to write inf
generally the [Version] area at the beginning:
eg: [version]
signature = "$ xxxx $"
advanced INF = 2.
the most important [Add.Code] area is next:
eg: [add.
ctrl1.dll = c1section
ctrl2.dll = ctrl2.dll
The file name to be downloaded is in front, followed by the region name corresponding to this file, which can be any name, but it is generally the same as the file name, which is convenient for maintenance. It should also be noted that the files appearing in the [Add.Code] area should be sorted according to their dependencies. For example, as mentioned earlier, ctrl1.dll depends on ctrl2.dll, and ctrl2.dll appears before ctrl1.dll. Because the installation is carried out in the reverse order, that is to say, ctrl2.dll is installed first, and then ctrl1.dll is installed. Remember it clearly, don't make it backwards.
then there is the area of each file
[ctrl1.dll]
file-win32-x86 = thiscab
register server = yes
clsid = {...}
destdir =
file version = 1,,,
the first file value in the [ctrl1.dll] area tells ie where to get this dll. file * * * consists of three parts, the first part is file, and this will always be like this (at least for now); The second part tells the declared supported OS, win32 stands for windows, and mac is Apple MAC OX; The third part is CPU type, such as x86, ppc (Power PC), mips or alpha.
the value of p>file can take three URLs, ignore and thiscab. If it is a URL, go to the location of the URL. If it is ignore, it means that this file does not need to be downloaded for this OS and CPU (ctrl1.dll); If it is thiscab, it is obviously in the current cab file.
the next step is the RegisterServer. You can take two values, yes andno. If yes, ie needs to register the dll; if no, it is not necessary.
then DestDir, whose value is the location where the dll will be saved to the local hard disk. If its value is 1, put the dll under \Windows or \WinNT; If it is 11, put it under \Windows\System or
\WinNT\System32; If it is empty (that is, it has no value), it will be placed in the Downloaded Program Files directory under \Windows or \WinNT;
finally, the FileVersion, which is more obvious, shows the version number of ctrl1.dll.
sometimes when we use VB to develop controls, we need to install the virtual machine of VB, which needs some other explanations. Briefly:
add an item MSVBVM6.DLL=MSVBVM6.DLL in [Add.Code] (taking VB6 as an example). Here is the
MSVBVM6.DLL area:
[msvbvm6.dll]
hook = msvbvm6.cab _
the hook area is an area that needs to be executed during installation. It can be divided into two types, one is conditional and the other is unconditional. The unconditional hook area must be executed. Otherwise, whether to execute it is judged according to the conditions. The area marked with [Setup Hooks] is an unconditional area, as shown below
[setup hooks]
hook name = section-name
[section-name]
run =% extract _ dir% \ setup.exe
Unconditional areas are often used to execute an installation program through an inf file. This is why we install such a menu when right-clicking an inf file in the resource manager.
When ie downloads a cab file, if there is no [Add.Code] in the file, we will handle the [Setup Hooks] area and run the program specified by Run, which is setup.exe.
The conditional area is executed under certain conditions. The hook area specified for MSVBVM6.DLL is a conditional area. If the CLSID or version specified in MSVBVM6.DLL cannot meet the needs and there is no named value of file, the area specified by hook will be executed.
[MSVBVM6.cab_Installer]
file-win32-x86 =/controls/vb6/vbrun6.cab
run =% extract _ dir% \ vbrun6.exe
The above [msvbvm6.cab _ installer] is a hook. Run explains which file to execute
It is necessary to explain here that MS can include these files in the cab file by specifying the CODEBASE attribute as /controls for some commonly used Redistributable Microsoft DLLs
. There is a file redist.txt on the computer whose dll is Redistributable Microsoft DLLs
Create a cab file:
cabarc nctrl1.cabctrl1.infctrl 1.dll
n means to create a new file, ctrl1.cab is the created file name, ctrl 1.inf is the inf of the cab, and then it is a file that needs to be added to the cab. Wildcards can be used.
then you can p>< the cab file on the web page
<; OBJECT ID="Ctrl1Obj"
CLASSID="clsid:....................................."
CODEBASE="/ctrl1.cab#version=8,,,57">
< /OBJECT>
there is also a version here, but the version here refers to the version of the control, and the version in the inf is the version of the file.
making electronic signature:
firstly, download the signature making tool SignCode from the following website, the address is
/workshop/gallery/tools/authcode.asp
get a certificate from a signature authorization center such as VeriSign or the Microsoft Certificate
Server authorization server running on your local area network, and you will get a private key in the process of applying for authorization.
you can also use the private keys created by MakeCert.exe and Cert2Spc.exe for testing. The method is to create an X.59 certificate(.cer file)
MakeCert-svmykey.pvkn "cn = my software company" mycert.cer
first, and then convert the. cer file into PKCS # by using Cert2Spc. 7 software release Certificate(.spc file),
cert2scpmycert. cermycert.spc
use the SignCode you downloaded to electronically sign your cab file
signcode-spcmercert.spc-vmykey.pvk-t/scripts/timstamp.dll ctrl 1.cab
signcode can also specify some other parameters, so it's too long.
although you can use the tested. cer and. spc files, you must apply for them when you publish them.
in fact, everything is explained in the SDK, but it's all in E. Take your time and you won't find anything.