How to create the. Cab installation package and fields in the INI File

Source: Internet
Author: User

Creating the cab installation package is quite simple.
To modify the registry, we recommend that you use the cab installation package for installation. First, you need the following files:
, Cabwizsp.exe
, Cabwiz. DDF.
Now let's go to the main text. To create a. cabinstaller, you only need to write a. inffile. cabwizsp.exe will generate _ setup. XML based on your inf file.
How to write the file? In fact, it is very simple. I will provide a template. You only need to modify the field after [sourcedisksfiles. Next I will explain the meaning of the main fields.
The provider in the first field [version] can be changed at will, so do not touch the other two parameters. Appname = "" of the Second Field [cestings] is the name of the program you want to install. The complete name will be a character of the provider Parameter
String with the appname parameter, such as the template. The name displayed in the deletion program is "mgcn iMac ". The third field is [cedevice. arm720], and the cedevice field is the device platform corresponding to the program.
You don't have to worry about it. Just add this field when writing the smartphone inf file. The following [sourcedisksnames] specifies the disk and path of the source file. I am not sure about it here. The example in the SDK
Also
I can't understand it, nor can I use an absolute path. Simply use it directly. replace: copy the file (See Supplement 1). In this way, you only need to put the file to be packaged together with INF. Below
A field [sourcedisksfiles] is the list of files to be packaged. The value = 1 is the file path, that is, in [sourcedisksnames ].
1. The next field [defainstall install] is the installation step. The copyfiles parameter and addreg parameter in the template indicate that the installation is not only to decompress and copy the file, but also to repair
Modify the registry. Copyfiles = followed by the field name, that is, what exactly do you want to copy. Addreg = works the same way. For example
In, copyfiles‑copytohomedir,copytoimacdir?cabwizsp.exe needs to copy two files. The first one is
Copy some files to the home folder. The files to be copied are in the [copytohomedir] field. The second is to copy some files to the iMac folder.
[Copytoimacdir] And addreg = regdata indicates that the installation program also needs to modify the registry. The modified content is in the [regdata] field. The next field is the target.
Folder location. The two parameters copytohomedir and copytoimacdir must be the same as the two strings on the right of the copyfiles equal to the previous field.
Here, I do not know what it means. The SDK cannot be found. % ce19 % indicates/storage/application data (see the final comment ),
The next field [copytohomedir] is the specific task allocation. The quotation marks indicate the extracted file name, which must be the same as the file name before compression.
[Sourcedisksfiles] can find the corresponding file, which indicates the file name after the file is copied to the corresponding directory. If there are no special requirements, do not change the name. The following field corresponds to this field.
Similarly, I will not talk much about it. The last step is to modify the Registry segment. The first "," indicates the names of the four major blocks in the registry. You can simply use the abbreviations, as HKLM in the template indicates
HKEY_LOCAL_MACHINE. The other three are hkcr, hkcu, and HKU. The second "," indicates the specific path of the key you want to modify (if not
Create), that is, the complete item (key) name, the third ", "Previously, it indicates the key you want to modify (that is, the value name we often see in the Registry Article). If it does not exist, the program will be automatically created, and the fourth", "indicates the value type. Currently, I only know that the integer is 0x00010001 (See Supplement 2 ).
This
You don't need to fill it out, just keep. Finally, it is the value you want to fill in. For example, HKLM, software/Microsoft/Shell
/RAI/: callalert, bkbitmapfile, "/storage/Application
Data/home/iMac/call1.jpg"
Indicates to modify (create) the value of the key named bkbitmapfile, which is stored in HKLM/software/Microsoft/Shell/Rai
/: The value in callalert is/storage/application.
Data/home/iMac/call1.jpg, which is a string-type key. I don't want to mention the integer. There are examples. I believe you can understand them.
After writing the infobile, copy the file you want to pack and the infobile file to the directory containing cabwizsp.exe and cabwiz. DDF. In Command Line Mode
Enter cabwizsp xx. INF, XX indicates your name for the INF file, so a file with _ setup. XML. the cab package is generated. Install it and check your own results.

Note: % A % indicates the reference value of the parameter. For example, copytohomedir = 1, % CE1 %/% appname % indicates/storage/program.
Files/mgcn iMac. (In the example, appname = provider + appname = "mgcn" + "iMac"). For % cex %
The program will be automatically translated during installation, for example, % ce19 % the translation result is/application data, and CE1 indicates/program files, CE2 indicates/Windows
,
The system adds the default storage volume name to the translated results (provided that the default storage volume name exists), such as the default magnetic field of smartphone.
If the disk volume is marked as storage, % ce19 % will eventually become/storage/application data. If you are interested, go to the SDK
Check the total number of % cex %.
1. From the modaco English article, [sourcedisksnames] contains four domains separated by commas. The first domain is disk_id, and the disk
(I have tried everything, so I really don't understand what it means... you can manage it as a table .), The second field is the annotation. To use "" to include the annotation content, the third field is unknown, and the fourth field is the file path.
Path, "." indicates the current directory, and ".." indicates the upper-level directory of the current directory.
Supplement 2: The fourth "," 0x00010001 is called a flag. It should be said that it indicates the specific type of the following value. Several flags are described as follows:
Zero X 00000002
If the registered key (value) exists, do not modify it. If it does not exist, the value is equal to the content of the last domain (nonsense ...) this flag can be used with any of the following flags.
Don't understand. If you use this flag, the following content is of the string type. You can specify the type of the subsequent content, but I cannot try it out, no instructions can be found in the SDK,
It is estimated that you have to go to msdn to find it ...)
0x00000000 indicates the string type, which corresponds to the REG_SZ data type in the registry.
Zero X 00010000
Multi-string type, corresponding to reg_multi_sz data type. It contains many strings separated by commas.
HKLM, software/Microsoft/Shell/RAI/: msclog, bkflags, 0x00010000, "XXX", "yyy", "Zzz"
Zero X 00000001
The binary type, which corresponds to the REG_BINARY data type in the registry. You can write several different binary data types. Each binary number represents a domain, which is separated ",".
Headers with 0x (hexadecimal headers ).
The format is as follows: HKLM, software/Microsoft/Shell/Rai
/: Msclog, bkflags, 0x00000001,00, 01,11, 10, 11, 10
Zero X 00010001
It is an integer that corresponds to the REG_DWORD data type in the registry. If the number is preceded by 0x, it indicates a hexadecimal number, which is automatically translated into decimal when written to the Registry.
For example, HKLM, software/Microsoft/Shell/RAI/: msclog, bkflags, 0x00010001, 0x26 is generated.
In _ setup. XML, 0x26 is changed to 38, datatype or integer.
Supplement 3: [String] field. This field is used to define
You
The abbreviation of the string to be reused, such as "software/Microsoft/my test
APP "this string is used a lot. You can use R to represent it, as long as you write r =" software/Microsoft/my test app "in this field"
In the following field, you can use % R % to represent software/Microsoft/my test.
App. For example, in the Registry field, you can write HKLM, % R %, test, 0x00010003, which is equivalent
HKLM, software/Microsoft/my test app, test, 0x00010001, 3
4: Create a shortcut. The format is as follows, mainly to add the corresponding project in [defainstall install] and [destinationdirs], and to create a field, the field name can be obtained at will, note that the names of the three fields must be the same. For example:
[Defainstall install]
Ceshortcuts = shortcuts
[Destinationdirs]
Shortcuts = 0, % ce14 %
[Shortcuts]
Sample app,0 sample.exe
Sample app,0, sample.exe, % installdir %
The syntax of the last field indicates that the four fields are separated by commas (,). The content of the first three fields must be filled in. The first field is the shortcut key name, and the second field 0 indicates the file.
A non-zero number indicates a directory. The third field is the target program (directory) of the shortcut key, the fourth field is the optional field, and the directory where the shortcut key is placed. The default directory is in [destinationdirs ].
Shortcuts = "", you can specify other directories, such
If you add your own shortcut key, write storage/Windows/startmenu/here /.

Finally, it should be noted that, in order to make it easy for you to see clearly, commas are all expressed in full angles. The inf file involves system-related things and cannot use the full-angle symbols. I have not tried the strings yet, however, I suggest you use English as much as possible ....

 

TEMPLATE 1: The inf file of the iMac topic I wrote.
[Version]
Signature = "$ Windows NT $"
Provider = "mgcn"
Cesignature = "$ Windows CE $"
[Cestrings]
Appname = "iMac"

[Cedevice. arm720]
Processortype = 0
[Sourcedisksnames]
1 =.
[Sourcedisksfiles]
IMac. Home. xml = 1
Alert.jpg = 1
App.jpg = 1
Batterieoff.bmp = 1
Batterieon.bmp = 1
Batterymask.gif = 1
Calendar.jpg = 1
Call1.jpg = 1
Call.jpg = 1
Confirm.jpg = 1
Contacts.jpg = 1
Dial.jpg = 1
Dialback.jpg = 1
Error.jpg = 1
I1.gif = 1
I2.gif = 1
I3.gif = 1
I4.gif = 1
Incall.jpg = 1
Info.jpg = 1
KBAT. ini = 1
Kdh2.jpg = 1
Newhome.jpg = 1
Pro.jpg = 1
Programs.jpg = 1
Sm.jpg = 1
Volume.jpg = 1

[Defainstall install]
Copyfiles = copytohomedir, copytoimacdir
Addreg = regdata
[Destinationdirs]
Copytohomedir = 0, % ce19 %/home
Copytoimacdir = 0, % ce19 %/home/iMac
[Copytohomedir]
"IMac. Home. xml", iMac. Home. xml
[Copytoimacdir]
"Alert.jpg", alert.jpg
"App.jpg", app.jpg
"Batterieoff.bmp", batterieoff.bmp
"Batterieon.bmp", batterieon.bmp
"Batterymask.gif", batterymask.gif
"Calendar.jpg", calendar.jpg
"Call1.jpg", call1.jpg
"Call.jpg", call.jpg
"Confirm.jpg", confirm.jpg
"Contacts.jpg", contacts.jpg
"Dial.jpg", dial.jpg
"Dialback.jpg", dialback.jpg
"Error.jpg", error.jpg
"I1.gif", i1.gif
"I2.gif", i2.gif
"I3.gif", i3.gif
"I4.gif", i4.gif
"Incall.jpg", incall.jpg
"Info.jpg", info.jpg
"KBAT. ini", KBAT. ini
"Kdh2.jpg", kdh2.jpg
"Newhome.jpg", newhome.jpg
"Pro.jpg", pro.jpg
"Programs.jpg", programs.jpg
"Sm.jpg", sm.jpg
"Volume.jpg", volume.jpg

[Regdata]
HKLM, software/Microsoft/Shell/RAI/: callalert, bkbitmapfile, "/storage/Application Data/home/iMac/call1.jpg"
HKLM, software/Microsoft/Shell/RAI/: errorbox, bkbitmapfile, "/storage/Application Data/home/iMac/error.jpg"
HKLM, software/Microsoft/Shell/RAI/: exclamationbox, bkbitmapfile, "/storage/Application Data/home/iMac/alert.jpg"
HKLM, software/Microsoft/Shell/RAI/: informationbox, bkbitmapfile, "/storage/Application Data/home/iMac/info.jpg"
HKLM, software/Microsoft/Shell/RAI/: questionbox, bkbitmapfile, "/storage/Application Data/home/iMac/confirm.jpg"
HKLM, software/Microsoft/Shell/RAI/: voldlg, bkbitmapfile, "/storage/Application Data/home/iMac/volume.jpg"
HKLM, software/Microsoft/Shell/RAI/: msstart, bkbitmapfile, "/storage/Application Data/home/iMac/programs.jpg"
HKLM, software/Microsoft/Shell/RAI/: mscprog, bannerimage, "/storage/Application Data/home/iMac/incall.jpg"
HKLM, software/Microsoft/Shell/RAI/: mscprog, bkbitmapfile, "/storage/Application Data/home/iMac/dialback.jpg"
HKLM, software/Microsoft/Shell/RAI/: mscdial, bannerimage, "/storage/Application Data/home/iMac/dial.jpg"
HKLM, software/Microsoft/Shell/RAI/: msclog, bkbitmapfile, "/storage/Application Data/home/iMac/programs.jpg"
HKLM, software/Microsoft/Shell/RAI/: msclog, bkflags, 0x00010001,26
HKLM, software/Microsoft/Shell/RAI/: mscontacts, bkbitmapfile, "/storage/Application Data/home/iMac/contacts.jpg"
HKLM, software/Microsoft/Shell/RAI/: mscontacts, bkflags, 0x00010001,26
HKLM, software/Microsoft/Shell/RAI/: mssyncapp, bkbitmapfile, "/storage/Application Data/home/imacx/programs.jpg"
Hkcu, controlpanel/home, scheme, "/storage/Application Data/home/iMac. Home. xml"
Hkcu, controlpanel/home, bgimage ,,
Hkcu, controlpanel/home, colorscheme ,,

 

Template 2: INF file of the e200 plug-in [version]
Signature = "$ Windows NT $"
Provider = "orange"
Cesignature = "$ Windows CE $" [cestrings]
Appname = "e200's plugin"
[Cedevice. arm720]
Processortype = 0 [sourcedisksnames]
1 =. [sourcedisksfiles]
4orangeh. dll = 1
[Defainstall install]
Copyfiles = copytohomedir
Addreg = regdata [destinationdirs]
Copytohomedir = 1, % ce19 %/home [copytohomedir]
"4orangeh. dll", 4orangeh. dll
[Regdata]
Hkcr, CLSID/{A2536C54-6AC2-4C31-9542-B144B0E9D077}/inprocserver32, "/storage/Application Data/home/4orangeh. dll"
Hkcr, CLSID/{A2536C55-6AC2-4C31-9542-B144B0E9D077}/inprocserver32, "/storage/Application Data/home/4orangeh. dll"
Hkcr, CLSID/{A2536C56-6AC2-4C31-9542-B144B0E9D077}/inprocserver32, "/storage/Application Data/home/4orangeh. dll"
Hkcr, CLSID/{A2536C57-6AC2-4C31-9542-B144B0E9D077}/inprocserver32, "/storage/Application Data/home/4orangeh. dll"
Hkcr, CLSID/{A2536C58-6AC2-4C31-9542-B144B0E9D077}/inprocserver32, "/storage/Application Data/home/4orangeh. dll"
Hkcr, CLSID/{A2536C59-6AC2-4C31-9542-B144B0E9D077}/inprocserver32, "/storage/Application Data/home/4orangeh. dll"
Hkcr, CLSID/{A2536C5B-6AC2-4C31-9542-B144B0E9D077}/inprocserver32, "/storage/Application Data/home/4orangeh. dll"

 

Http://msdn.microsoft.com/en-us/library/aa924371.aspx

Http://www.devdiv.net/viewthread.php? Tid = 1594 & extra = Page % 3d1

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.