这里搜了下没有..转过来~
INF文件全称Information File文件,是Winodws操作系统下用来描述设备或文件等数据信息的文件。INF文件是由标准的ASCII码组成,您可以用任何一款文字编辑器查看修改其中的内容。一般我们总是认为INF文件是系统设备的驱动程序,其实这是错误的认识,Windows之所以在安装某些硬件的驱动时提示需要INF文件是因为INF文件为该设备提供了一个全面描述硬件参数和相应驱动文件(DLL文件)的信息。就好比我们看着说明书安装电脑硬件一样,我们就是Windows系统,说明书就是INF文件。INF文件功能非常强大,几乎能完成日常操作的所有功能。您可以把它看成是Windows系统底下的超强批初理。要熟练掌握和理解甚至是编写INF文件需要对其内部结构有相当的认识。下面就让我们来深入到INF文件中的内部一窥其真面貌吧!
INF文件的组成有节(Sections),键(Key)和值(value)三部分。
关键节有
版本描述信息,主要用于版本控制。
字符串信息,用于常量定义。
定义系统路径信息。
指明源盘信息。
指明源盘文件名。
开始执行安装。
其它的节可以自定义,下面用一实例来具体讲解。
程序代码
Signature=$Chicago$
Provider=%Author%
Product="添加文件关联演示"
Version="1.0"
Author="Xunchi"
Copyright="Copyright 2005"
CustomFile="inf" ;修改您需要的文件名后缀
Program="NOTEPAD.EXE" ;修改您需要关联的应用程序名
HKCR,"."%CustomFile%,"",FLG_ADDREG_TYPE_SZ ,%CustomFile%File
HKCR,%CustomFile%File,"",FLG_ADDREG_TYPE_SZ,安装信息
HKCR,%CustomFile%"File\shell","",FLG_ADDREG_TYPE_SZ,open
HKCR,%CustomFile%"File\shell\open\command","",FLG_ADDREG_TYPE_SZ,%program% %1
AddReg=Add.Reg
在节中"Signature"项定义了该INF文件需要运行在何种操作系统版本中。有$Windows NT$, $Chicago$, or $Windows 95$三个值供选择,一般选择$Chicago$即可。项Provider中定义了该文件的创作来源,%Author%指引用Author项的值。您也可自定其它项来描述该INF文件的版本信息。该INF文件的作用是关联文件,所以主要是对注册表的操作,我们来看节,共四条语句,格式都是一样。HKCR表示根HKEY_CLASSES_ROOT,第二个参数是子键的路径名,第三个参数是表明值的类型,最后是值(具体见附表)。以上都是对操作的定义与过程,在节中是开始执行要安装的流程,AddReg表明是对注册表进行操作,操作对象是Add.Reg节中的定义。如果您把AddReg换成DelReg则是删除注册表中的键值。当鼠标单击该INF文件在弹出的菜单中选择“安装”就开始执行您所定义的操作。该示例在系统的INF文件右键菜单中增加了查看编辑功能并设置了默认动作,因为在安装了不了解的INF文件有可能对系统产生不良的影响,这样双击文件就可打开编辑该文件了。
再看看INF文件在文件操作方面的能力吧。请看下面的一个例子。
程序代码
Signature=$Chicago$
Provider=%Author%
Product="文件复制和安装演示"
Version="1.0"
Author="Xunchi"
Copyright="Copyright 2005"
ProcessList.exe ;此文件已在当前目录下,下同。
Wordpad.exe
FileList=11 ;安装到Windows的系统目录
FileList1=10 ;安装到Windows目录
Copyfiles=FileList,FileList1
相同的节的作用与上一例类似,请注意新出现的节,这是我自定义的节名,它表示了一个文件组,也类似。在节中需定义每个文件组复制到的目录(各个常量的意义见附表)。Copyfiles指明了需要进行复制的文件组。
INF文件的操作还包括服务(NT系统)程序的安装和卸载,INI文件的转换等。由于这些操作都比较的复杂和繁琐,且有一定的危险性故下次有机会再向大家进行深入探讨。
最后我们来看一下INF文件的执行机制,这时你也许要问不就是简单的执行一下“安装”吗?知其然不知其所以然知识水平是不会提高的。在“文件夹选项”中的“文件类型”找到INF文件的“安装”命令看到一串命令。“rundll32.exe setupapi,InstallHinfSection DefaultInst_all 132 %1”它表示了运行Dll文件setupapi.dll中的命令InstallHinfSection并传递给它起始节的名字 DefaultInstall。可见起始节是可以自定义的。INF文件的执行也可用在各种支持API调用的编程工具中。至此INF文件的结构和运行机制我们已基本了解,现在就让你的思维开动起来,让它更好的为我们工作吧。
注册表操作的常量定义:
----------------------------------------------------------
常量 根值
HKCR HKEY_CLASSES_ROOT.
HKCU HKEY_CURRENT_USER.
HKLM HKEY_LOCAL_MACHINE.
HKU HKEY_USERS.
-----------------------------------------------------------
FLG_ADDREG_APPEND 在多字符串后添加字符
FLG_ADDREG_TYPE_SZ 字符类型
FLG_ADDREG_TYPE_MULTI_SZ 字符串类型
FLG_ADDREG_TYPE_EXPAND_SZ 扩展字符串类型
FLG_ADDREG_TYPE_BINARY 二进制值
FLG_ADDREG_TYPE_DWORD DWord值
FLG_ADDREG_TYPE_NONE NULL值
----------------------------------------------------------
节中所定义的常量路径
----------------------------------------------------------
01 源目录(后跟路径)
10 Windows目录
11 Windows系统目录
12 驱动目录
17 INF文件目录
18 帮助文件目录
20 字体目录
21 根目录
24 应用程序目录
25 共享目录
30 当前根目录
50 System目录
51 Spool 目录
52 Spool 驱动目录
53 用户配置目录
----------------------------------------------------------
节中定义的操作
----------------------------------------------------------
LogConfig Log日志文件配置
Copyfiles 复制文件
Renfiles 文件改名
Delfiles 删除文件
UpdateInis 更新Inis
UpdateIniFields 更新Ini字段
AddReg 添加注册项
DelReg 删除注册项
Ini2Reg Ini文件转换为Reg文件
----------------------------------------------------------
INF的功能
1 复制文件、删除文件、或重新命名文件。
2 新增或删除注册表(Registry)中的项目。
3 修改重要的系统设置文件(如 Autoexec.bat、Config.sys、.INI 等)
INF的规则
INF是纯文本文件,它是分节的,这点和INI文件类似,每节以""扩起来,每一个节名最长为255个字符(Windows 2000/XP/2003操作系统中)或28个字符(Windows 98操作系统中)。在节与节之间的内容叫条目,每一个节又是由许多的条目组成的,每一个条目都由=分开,如a="b"。如果每一个条目的等号后有多个值,则每一个值之间用","号分隔开。INF对大小写不敏感,行注释语句命令是";",类似VB里的’。如果一行写不下,使用"\"来换行。
INF的运行
.INF文件是由Windows的SetupAPI解释执行的脚本文件,它的运行过程很简单,是一种线性的执行,线性的意思就是.INF文件的运行过程不存在分支语句,也就是没有条件语句,一旦开始执行,就是沿着固定的路线运行。它的运行是按照节为单位来执行的,从某一个节开始执行,从上到下执行该节中的条目,如果该条目是一个节,那么就一条条执行子节中的条目,如此递归执行。在WINDOW上运行只要右击这个文件,点击安装即可。
INF的语法结构
;指定版本和签名节
;系统根据Signuture看是不是适合当前版本,如果适合的话就执行,否则不执行,当然强制安装是可以的
;用于WIN9X
Signature="$CHICAGO$"
;WINNT+
;Signature="$Windows NT$"
;指定安装文件布局,该行是可选的,如果没有提供布局信息文件,则在INF文件内必须包含和节
LayoutFile=filename.inf
节
节罗列源文件所在盘符序列码、盘描述符、盘卷标号和盘序列号。
节内语句的语法为:
disk-ordinal=“disk-description”,disk-label,disk-serial-number
其中disk-ordinal为必选项,是盘符序列码,标识一个源盘,具有惟一性,一般可设置为从1开始递增的整数,0不是一个有效的盘符序列码。当存在多个源盘时,盘符序列码之间不能重复。
disk-description为必选项,是盘描述符,用双引号括起的字符串或字符串宏描述盘的内容或目的。安装引擎将该字符串显示在对话框内以提示用户。
disk-label为源盘的卷标识。
disk-serial-number未使用,但必须被设置为0。
节
节指定安装时使用的源文件和盘符序列码、盘描述符。 节内语句的语法为:
file-name=disk-number
其中file-name为必选项,是源盘上文件的名称。
disk-number是包含file-name指定文件所在源盘的盘符序列码,该盘符序列码需在节中列出,并大于或等于1。
Subdir为可选项,指定文件所在源盘的子目录,如省略则源盘为缺省安装路径。
file-size为可选项,表明文件的大小,以字节为单位。
;指定CopyFiles、RenFiles或DelFiles入口的缺省操作目录
;语法file-list-section=LDID,
;LDID列表如下:
;01 ;current directory
;04 ;backup directory
;10 ;windows directory
;11 ;system dir
;12 ;iosubsys
;13 ;command
;14 ;control panel directory
;15 ;printers directory
;16 ;workgrou dir
;17 ;inf dir
;18 ;help dir
;19 ;administration dir
;20 ;fonts
;21 ;viewers
;22 ;vmm32
;23 ;color dir
;25 ;shared dir
;26 ;winboot
;28 ;host winboot
;30 ;root of boot drive
;31 ;root of host drive of a virtual boot drive
;32 ;old windows dir if exists
;以下例子为安装到window\web目录下
;DefaultDestDir=10,"web"
;节提供了一个INF文件安装过程的总览,它识别文件内其他包含安装信息节的详细动作,是Windows内建安装函数识别安装过程和内容的真正入口
;节分和两类
;节节名DefaultInstall如前面表格内容所述被显式地在注册表中指定。
;该节也是系统获取INF文件中安装信息的首要入口,当用户右击INF文件选“安装”时该节内容被执行。
;与节遵循相同的语法,但必须被显式地调用,常被用来定义反安装动作
;缺省安装节
;指明添加注册表的子节,等号后面的为自定义节名,例子见节
ADDREG=add
;指明要删除的注册表子节,等号后面的为自定义节名
DELREG=del
;指明要要复制的文件子节,用于安装,Copyfiles命令可以替换系统正在访问的文件。这些功能通过普通的del和copy命令都无法实现
CopyFiles=cfile
;指明要要删除的文件子节,用于反安装,多个节以逗号隔开,该命令如果发现要删除的文件被锁定,就会把文件放到系统删除队列中排队
;等系统重启动的时候,该文件就自动被删除了
DelFiles=删除文件段
;
;文件名列表
;例子:
;a.exe
;b.sys
;重命名文件段
;RenFiles=重命名文件段
;
;语法:
;
;new-file-name,old-file-name
;file1,file2 ;修改文件名file1为file2
;更新INI文件段内容子节
UpdateInis = 更新INI文件段
;
;ini-file, ini-section, , ,
;ini-file 包含要更改条目的 .ini 文件名
;ini-section 包含要更改条目的节名
;old-ini-entry 可选,常用形式为 Key=Value
;new-ini-entry 可选,常用形式为
;Key=Value。flags 是可选操作标记
;例子
;%01%\wincmd.ini, Configuration,,"InstallDir=%01%"
;%01%\wincmd.ini, Configuration,,"Mainmenu=%01%\LANGUAGE\TCExtMenu.mnu"
;更新ini文件值内容
updateinifield =
;ini文件更新注册表
ini2reg=aa.ini
;更新config.sys内容
updatecfgsys=更新autoexec.bat段
;更新autoexec.bat内容
updateautobat=更新autoexec.bat段
;定义资源节,像资源文件,调用时使用%REG_SZ%就代表了0x00000000
REG_SZ=0x00000000
REG_BINARY=0x00000001
REG_DWORD=0x00010001
;自定义添加注册表项的节
;注意格式:HKEY(根键缩写),Subkey(子键),Valuename(键值名),Type(键值类型),Value(键值)
;HKCU -> HKEY_CURRENT_USER
;HKCR -> HKEY_CLASSES_ROOT
;HKLM -> HKEY_LOCAL_MACHINE
;HKU -> HKEY_USERS
;HKU -> HKEY_USERS
;HKCC -> HKEY_CURRENT_CONFIG
;HKDD -> HKEY_DYN_DATA
;解禁注册表编辑器
HKCU,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegistryTools,1,0
;解禁IE的Internet选项
HKCU,Software\Policies\Microsoft\Internet Explorer\Restrictions,NoBrowserOptions,1,0
;解禁IE的Internet选项里面的各个具体选项
HKCU,Software\Policies\Microsoft\Internet Explorer\Restrictions,NoBrowserOptions,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Settings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,HomePage,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,GeneralTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Cache,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,History,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Colors,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Fonts,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Languages,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Accessibility,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,SecurityTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,SecChangeSettings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,SecAddSites,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ContentTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Ratings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Certificates,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,CertifPers,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,CertifSite,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,CertifPub,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,FormSuggest,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,FormSuggest Passwords,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Wallet,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Profiles,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ConnectionsTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Connection Wizard,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Connwiz Admin Lock,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Connection Settings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Proxy,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,AutoConfig,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ProgramsTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ResetWebSettings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Check_If_Default,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,AdvancedTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Advanced,1,0
;解禁下载(可单独使用)
HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1803,1,0
;自动修改IE标题栏文字、主页、搜索页等等
HKCU,Software\Microsoft\Internet Explorer\Main,Window Title,0,"Internet Explorer"
HKCU,Software\Microsoft\Internet Explorer\Main,Start Page,0,"http://www.zmn120.net
HKCU,Software\Microsoft\Internet Explorer\Main,Search Page,0,"http://www.zmn120.net
HKCU,Software\Microsoft\Internet Explorer\Main,Default_Page_URL,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Default_Search_URL,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Search Page,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Start Page,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Default_Page_URL,0,
http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Default_Page_URL,0,
http://www.zmn120.net
;该节定义了将要删除的文件列表,filename后面的1是一个标志,指明如果文件当前无法删除,就等到系统重启动后删除。
;格式:filename,,,1
;例子:
a.exe,,,
I didn't find it after searching here~ Transferred over~
The
INF file is full name Information File, which is a file used to describe data information such as devices or files under the Windows operating system. The
INF file is composed of standard ASCII codes, and you can use any text editor to view and modify its content. Generally, we always think that the
INF file is the driver program of the system device, but this is a wrong understanding. The reason why Windows prompts that an
INF file is needed when installing the driver of some hardware is that the
INF file provides a comprehensive description of the hardware parameters and the corresponding driver file (DLL file) information. It is just like we install computer hardware by looking at the manual. We are the Windows system, and the manual is the
INF file. The
INF file is very powerful and can almost complete all the functions of daily operations. You can think of it as an extremely powerful batch processing under the Windows system. To master and understand even write
INF files, you need to have a considerable understanding of its internal structure. Now let's go deep into the
INF file to take a look at its true face!
The composition of the
INF file has three parts: sections, keys, and values.
The key sections are
version description information, mainly used for version control.
string information, used for constant definition.
define system path information.
indicate the source disk information.
indicate the source disk file name.
starts to perform installation.
Other sections can be customized. Let's use an example to specifically explain.
Program code
Signature=$Chicago$
Provider=%Author%
Product="Add file association demonstration"
Version="1.0"
Author="Xunchi"
Copyright="Copyright 2005"
CustomFile="inf" ;Modify the file name suffix you need
Program="NOTEPAD.EXE" ;Modify the application name you need to associate
HKCR,"."%CustomFile%,"",FLG_ADDREG_TYPE_SZ ,%CustomFile%File
HKCR,%CustomFile%File,"",FLG_ADDREG_TYPE_SZ,Installation information
HKCR,%CustomFile%"File\shell","",FLG_ADDREG_TYPE_SZ,open
HKCR,%CustomFile%"File\shell\open\command","",FLG_ADDREG_TYPE_SZ,%program% %1
AddReg=Add.Reg
In the section, the "Signature" item defines in which operating system version this
INF file needs to run. There are three values: $Windows NT$, $Chicago$, or $Windows 95$ for selection. Generally, $Chicago$ is selected. In the item Provider, the author of this file is defined, and %Author% refers to the value of the Author item. You can also customize other items to describe the version information of this
INF file. The function of this
INF file is to associate files, so it is mainly the operation of the registry. Let's look at the section, there are four statements, all in the same format. HKCR represents the root HKEY_CLASSES_ROOT, the second parameter is the path name of the subkey, the third parameter indicates the type of the value, and finally the value (specifically see the appendix). The above are all the definitions and processes of the operation. In the section , it is the process of starting to perform the installation to be installed. AddReg indicates that it is the operation on the registry, and the operation object is the definition in the Add.Reg section. If you replace AddReg with DelReg, it is to delete the key value in the registry. When you click the
INF file with the mouse and select "Install" in the pop-up menu, the operation you defined starts to be executed. This example adds the view editing function in the right-click menu of the system's
INF file and sets the default action. Because installing an unknown
INF file may have a bad impact on the system, double-clicking the file can open and edit this file.
Let's take a look at the capabilities of the
INF file in file operations. Please see the following example.
Program code
Signature=$Chicago$
Provider=%Author%
Product="File copy and installation demonstration"
Version="1.0"
Author="Xunchi"
Copyright="Copyright 2005"
ProcessList.exe ;This file is already in the current directory, the same below.
Wordpad.exe
FileList=11 ;Install to the system directory of Windows
FileList1=10 ;Install to the Windows directory
Copyfiles=FileList,FileList1
The role of the same section is similar to the previous example. Please pay attention to the newly appeared section , which is the section name I customized, which represents a file group, and is similar. In the section , the directory to which each file group is copied needs to be defined (the meanings of each constant are in the appendix). Copyfiles specifies the file groups that need to be copied.
The operations of the
INF file also include the installation and uninstallation of service (NT system) programs, the conversion of INI files, etc. Since these operations are relatively complex and cumbersome, and there is a certain risk, we will discuss them in depth next time when there is a chance.
Finally, let's take a look at the execution mechanism of the
INF file. At this time, you may ask, isn't it just simply executing "Install"? If you don't know why, your knowledge level will not improve. Find the "Install" command of the
INF file in "Folder Options" -> "File Types" and see a string of commands. "rundll32.exe setupapi,InstallHinfSection DefaultInst_all 132 %1" It means running the command InstallHinfSection in the Dll file setupapi.dll and passing the name of the starting section DefaultInstall to it. It can be seen that the starting section can be customized. The execution of the
INF file can also be used in various programming tools that support API calls. So far, we have basically understood the structure and operation mechanism of the
INF file. Now let your thinking start to work and let it work better for you.
Constant definitions for registry operations:
----------------------------------------------------------
Constant Root value
HKCR HKEY_CLASSES_ROOT.
HKCU HKEY_CURRENT_USER.
HKLM HKEY_LOCAL_MACHINE.
HKU HKEY_USERS.
-----------------------------------------------------------
FLG_ADDREG_APPEND Append characters after multi-strings
FLG_ADDREG_TYPE_SZ Character type
FLG_ADDREG_TYPE_MULTI_SZ String type
FLG_ADDREG_TYPE_EXPAND_SZ Expand string type
FLG_ADDREG_TYPE_BINARY Binary value
FLG_ADDREG_TYPE_DWORD DWord value
FLG_ADDREG_TYPE_NONE NULL value
----------------------------------------------------------
Constants for the section
----------------------------------------------------------
01 Source directory (followed by path)
10 Windows directory
11 Windows system directory
12 Driver directory
17
INF file directory
18 Help file directory
20 Font directory
21 Root directory
24 Application directory
25 Shared directory
30 Current root directory
50 System directory
51 Spool directory
52 Spool driver directory
53 User configuration directory
----------------------------------------------------------
Operations defined in the section
----------------------------------------------------------
LogConfig Log file configuration
Copyfiles Copy files
Renfiles Rename files
Delfiles Delete files
UpdateInis Update Inis
UpdateIniFields Update Ini fields
AddReg Add registry items
DelReg Delete registry items
Ini2Reg Convert Ini file to Reg file
----------------------------------------------------------
Functions of
INF
1 Copy files, delete files, or rename files.
2 Add or delete items in the registry.
3 Modify important system setting files (such as Autoexec.bat, Config.sys, .INI, etc.)
Rules of
INF
INF is a plain text file, which is sectional, similar to the INI file. Each section is enclosed by "". The longest length of each section name is 255 characters (in Windows 2000/XP/2003 operating systems) or 28 characters (in Windows 98 operating system). The content between sections is called entries. Each section is composed of many entries. Each entry is separated by =, such as a="b". If there are multiple values after the equal sign of each entry, each value is separated by ",".
INF is not case-sensitive. The line comment statement command is ";", similar to ’ in VB. If a line cannot be written down, use "\" to wrap the line.
Running of
INF
The .INF file is a script file executed by the Windows SetupAPI. Its running process is very simple, which is a linear execution. The meaning of linear is that there are no branch statements in the running process of the .INF file, that is, no conditional statements. Once execution starts, it runs along a fixed route. Its running is executed in units of sections. It starts from a certain section and executes the entries in this section from top to bottom. If this entry is a section, it executes the entries in the sub-section one by one, and so on recursively. To run on WINDOW, just right-click this file and click Install.
Syntax structure of
INF
; Specify the version and signature section
; The system checks whether it is suitable for the current version according to Signuture. If it is suitable, it will execute; otherwise, it will not execute. Of course, forced installation is possible
; For WIN9X
Signature="$CHICAGO$"
; WINNT+
; Signature="$Windows NT$"
; Specify the installation file layout. This line is optional. If the layout information file is not provided, the and sections must be included in the
INF file
LayoutFile=filename.inf
section
The section lists the disk sequence code, disk descriptor, disk volume label, and disk serial number where the source file is located.
The syntax of the statements in the section is:
disk-ordinal=“disk-description”,disk-label,disk-serial-number
Among them, disk-ordinal is a required option, which is the disk sequence code, identifies a source disk, and is unique. Generally, it can be set to an integer incremented from 1. 0 is not a valid disk sequence code. When there are multiple source disks, the disk sequence codes cannot be repeated.
disk-description is a required option, which is the disk descriptor, a string or string macro enclosed in double quotes to describe the content or purpose of the disk. The installation engine displays this string in the dialog box to prompt the user.
disk-label is the volume identifier of the source disk.
disk-serial-number is not used, but must be set to 0.
section
The section specifies the source file used during installation and the disk sequence code and disk descriptor. The syntax of the statements in the section is:
file-name=disk-number
Among them, file-name is a required option, which is the name of the file on the source disk.
disk-number is the disk sequence code of the source disk where the file specified by file-name is located. This disk sequence code needs to be listed in the section and is greater than or equal to 1.
Subdir is an optional option, specifying the subdirectory of the source disk where the file is located. If omitted, the source disk is the default installation path.
file-size is an optional option, indicating the size of the file in bytes.
; Specify the default operation directory for the CopyFiles, RenFiles or DelFiles entry
; Syntax file-list-section=LDID,
; LDID list is as follows:
; 01 ;current directory
; 04 ;backup directory
; 10 ;windows directory
; 11 ;system dir
; 12 ;iosubsys
; 13 ;command
; 14 ;control panel directory
; 15 ;printers directory
; 16 ;workgrou dir
; 17 ;inf dir
; 18 ;help dir
; 19 ;administration dir
; 20 ;fonts
; 21 ;viewers
; 22 ;vmm32
; 23 ;color dir
; 25 ;shared dir
; 26 ;winboot
; 28 ;host winboot
; 30 ;root of boot drive
; 31 ;root of host drive of a virtual boot drive
; 32 ;old windows dir if exists
; The following example is to install to the window\web directory
; DefaultDestDir=10,"web"
; The section provides an overview of the installation process of an
INF file. It identifies the detailed actions of other sections in the file that contain installation information. It is the real entry for the built-in installation function in Windows to identify the installation process and content
; The section is divided into two types: and
; The section name DefaultInstall of the section is explicitly specified in the registry as described in the previous table.
; This section is also the primary entry for the system to obtain the installation information in the
INF file. When the user right-clicks the
INF file and selects "Install", the content of this section is executed.
; follows the same syntax as the section, but must be explicitly called, and is often used to define the uninstall action
; Default installation section
; Specify the sub-section to add the registry. The custom section name after the equal sign, see the section for an example
ADDREG=add
; Specify the sub-section to delete the registry. The custom section name after the equal sign
DELREG=del
; Specify the file sub-section to be copied, used for installation. The Copyfiles command can replace the file that the system is accessing. These functions cannot be achieved through ordinary del and copy commands
CopyFiles=cfile
; Specify the file sub-section to be deleted, used for uninstallation. Multiple sections are separated by commas. If the command finds that the file to be deleted is locked, it will put the file in the system deletion queue and wait.
; When the system restarts, this file will be automatically deleted
DelFiles=Delete file segment
;
; File name list
; Example:
;a.exe
;b.sys
;Rename file segment
;RenFiles=Rename file segment
;
; Syntax:
;
; new-file-name,old-file-name
; file1,file2 ;Rename file file1 to file2
; Update INI file segment content sub-section
UpdateInis = Update INI file segment
;
; ini-file, ini-section, , ,
; ini-file .ini file name containing the entry to be changed
; ini-section section name containing the entry to be changed
; old-ini-entry optional, commonly used form is Key=Value
; new-ini-entry optional, commonly used form is
; Key=Value. flags is an optional operation flag
; Example
;%01%\wincmd.ini, Configuration,,"InstallDir=%01%"
;%01%\wincmd.ini, Configuration,,"Mainmenu=%01%\LANGUAGE\TCExtMenu.mnu"
; Update ini file value content
updateinifield =
; Ini file updates registry
ini2reg=aa.ini
; Update config.sys content
updatecfgsys=Update autoexec.bat segment
; Update autoexec.bat content
updateautobat=Update autoexec.bat segment
; Define resource section, like resource files. When called, %REG_SZ% represents 0x00000000
REG_SZ=0x00000000
REG_BINARY=0x00000001
REG_DWORD=0x00010001
; Custom section to add registry items
; Note the format: HKEY (root key abbreviation), Subkey (subkey), Valuename (key value name), Type (key value type), Value (key value)
; HKCU -> HKEY_CURRENT_USER
; HKCR -> HKEY_CLASSES_ROOT
; HKLM -> HKEY_LOCAL_MACHINE
; HKU -> HKEY_USERS
; HKU -> HKEY_USERS
; HKCC -> HKEY_CURRENT_CONFIG
; HKDD -> HKEY_DYN_DATA
; Unlock registry editor
HKCU,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegistryTools,1,0
; Unlock Internet options of IE
HKCU,Software\Policies\Microsoft\Internet Explorer\Restrictions,NoBrowserOptions,1,0
; Unlock various specific options in Internet options of IE
HKCU,Software\Policies\Microsoft\Internet Explorer\Restrictions,NoBrowserOptions,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Settings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,HomePage,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,GeneralTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Cache,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,History,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Colors,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Fonts,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Languages,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Accessibility,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,SecurityTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,SecChangeSettings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,SecAddSites,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ContentTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Ratings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Certificates,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,CertifPers,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,CertifSite,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,CertifPub,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,FormSuggest,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,FormSuggest Passwords,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Wallet,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Profiles,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ConnectionsTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Connection Wizard,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Connwiz Admin Lock,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Connection Settings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Proxy,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,AutoConfig,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ProgramsTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,ResetWebSettings,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Check_If_Default,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,AdvancedTab,1,0
HKCU,Software\Policies\Microsoft\Internet Explorer\Control Panel,Advanced,1,0
; Unlock download (can be used alone)
HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1803,1,0
; Automatically modify IE title bar text, homepage, search page, etc.
HKCU,Software\Microsoft\Internet Explorer\Main,Window Title,0,"Internet Explorer"
HKCU,Software\Microsoft\Internet Explorer\Main,Start Page,0,"http://www.zmn120.net
HKCU,Software\Microsoft\Internet Explorer\Main,Search Page,0,"http://www.zmn120.net
HKCU,Software\Microsoft\Internet Explorer\Main,Default_Page_URL,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Default_Search_URL,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Search Page,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Start Page,0,"http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Default_Page_URL,0,
http://www.zmn120.net
HKLM,SOFTWARE\Microsoft\Internet Explorer\Main,Default_Page_URL,0,
http://www.zmn120.net
; This section defines the list of files to be deleted. 1 after filename is a flag, indicating that if the file cannot be deleted currently, it will be deleted after the system restarts.
; Format: filename,,,1
; Example:
a.exe,,,