Extended use of the. inf file-create installation-free green software
In the production of green software, a special article I wrote (http://dream4ever.org/showthread.php? P = 33652 # post33652)
To package the Registry file and extracted software into a green software. However. the paths in the reg file are static. Once written, the paths will not change as the system changes. in the INF file, you can use variables to manipulate the path to track the changes in the path required by the installation program. The following uses a complete example to demonstrate how to use the. inf file to create a green software, and then describes the usage of the. inf file.
Emeditor's greening
After downloading the emeditorinstallation file emed404epx.exe, you can use WinRAR to open it. After decompression, run emeditor and find that you have lost the syntax configurations of predefined multiple text formats, we had to use the System Snapshot method. Follow the steps below:
1. Scan the system and create system snapshots. Here I only record the registry of the current system (because I don't think emeditor will copy files to the system directory. If the judgment is incorrect, it will cause "greening" failure ), run art (Advanced registery tracer) to scan the registry. Emeditor_snap.png. Do not disable art.
2. Install emeditor. You can uninstall it wherever you install it. After the installation, you can change the configuration or configure a new file type if needed. For example, I have added the nfo file type and set the character set associated with the nfo file, in this way, you can use emeditor to directly view the nfo file without a dedicated inspection tool.
3. record system changes. Scan the system again, take a snapshot of the system, scan the Registry again from art, then select the menu command registry-> compare heregion to directly use the keyboard F10, compare the result emeditor_compare.png, and click the Save to redo file button in the figure, stored as emeditor. reg file, close art.
4. Copy and uninstall the SDK. Copy the installed emeditor directory to another path and uninstall the emeditor program.
5. analysis. Open the exported emeditor. reg file. This is a huge reg file. Only Reg files have more than 1 MB, but don't worry. After reading the registry, delete the registry that is irrelevant to emeditor. For example, if the registry is only related to the resource manager, the remaining registry files can be divided into three parts. Some of them are in the Registry path [HKEY_LOCAL_MACHINE/software/emsoft]. Most of them do not involve paths. Only one of them records the path of emeditor, that is, "modulepath" = "h: // emeditor4 // "; there is also a majority of [HKEY_CURRENT_USER/software/emsoft/emeditor V3] under the Registry path, which contains many items involving the emeditor path, for example, "tmpl" = "H: // emeditor4 // template. XML "; there is also the Registry Settings associated with the extension of the emeditor and TXT files, set emeditor to the default source code check tool registry settings in IE, and register the COM component emedshl. DLL Registry (which is related to inprocserver32 ).
6. "green ".
6.1 store the content in the Registry path [HKEY_LOCAL_MACHINE/software/emsoft] To the emeditor_hklm.reg file, store the content in the Registry path [HKEY_CURRENT_USER/software/emsoft/emeditor V3] To the emeditor_hkcu.reg file, and first remove the remaining content from the COM component emedshl. DLL, and then stored in the emeditor_assoc.reg file.
6.2 extract the Registry content of the paths involved in the emeditor_hklm.reg and emeditor_hkcu.reg files and store them in the emeditorconf. reg file.
6.3 green software production, the core of which is to obtain the Registry changes made by the original software installation program, and then export the changes as a registry file. Reg for further analysis. If the exported. reg file does not include an absolute path, you can package the Registry file and extracted software into a green software. If. the reg file contains the absolute installation path of the current software, so you must manually modify the path in the registry every time. This is very troublesome and reduces the significance of making the Software green. Using the. inf file and the addreg command can easily solve the difficulty of the Registry path.
Then, replace the path H:/emeditor4 In the converted emeditor_assoc.inf file and emeditorconf. inf file with % 01%. The content of the emeditorconf. inf file is as follows:
[Version]
Signature = "$ Chicago $"
[Defainstall install]
Addreg = emeditorconf_addreg
HKLM, "software/emsoft/emeditor V3/common", "modulepath", "% 01% /"
Hkcu, "software/emsoft/emeditor V3/config/C ++", "tmpl", "% 01%/template. cpp"
Hkcu, "software/emsoft/emeditor V3/config/CSS", "tmpl", "% 01%/template.css"
Hkcu, "software/emsoft/emeditor V3/config/html", "tmpl", "% 01%/template.htm"
Hkcu, "software/emsoft/emeditor V3/config/Java", "tmpl", "% 01%/template. Java"
Hkcu, "software/emsoft/emeditor V3/config/JavaScript", "tmpl", "% 01%/template. js"
Hkcu, "software/emsoft/emeditor V3/config/jsp", "tmpl", "% 01%/template. jsp"
Hkcu, "software/emsoft/emeditor V3/config/Perl", "tmpl", "% 01%/template. pl"
Hkcu, "software/emsoft/emeditor V3/config/PHP", "tmpl", "% 01%/template. php"
Hkcu, "software/emsoft/emeditor V3/config/Python", "tmpl", "% 01%/template. py"
Hkcu, "software/emsoft/emeditor V3/config/ruby", "tmpl", "% 01%/template. RB"
Hkcu, "software/emsoft/emeditor V3/config/tex", "tmpl", "% 01%/template. Tex"
Hkcu, "software/emsoft/emeditor V3/config/VBScript", "tmpl", "% 01%/template. vbs"
Hkcu, "software/emsoft/emeditor V3/config/VBScript for emeditor", "tmpl", "% 01%/template. vbee"
Hkcu, "software/emsoft/emeditor V3/config/Windows Script", "tmpl", "% 01%/template. WSF"
Hkcu, "software/emsoft/emeditor V3/config/XML", "tmpl", "% 01%/template. xml"
6.4 write a batch file install. bat with the following content:
Regedit emeditor_hklm.reg
Regedit emeditor_hkcu.reg
Rundll32.exe setupapi. dll, installhinfsection defaultinstall 128./emeditorconf. inf
Regsvr32 emedshl. dll
Rundll32.exe setupapi. dll, installhinfsection defaultinstall 128./emeditor_assoc.inf
6.5 store the install. bat, emeditorconf. inf, emeditor_assoc.inf, emeditor_hklm.reg, and emeditor_hkcu.reg5 files in the emeditor directory and delete the remaining registry files.
6.6 write the corresponding unmount batch file according to the installation steps and install. bat, which is relatively simple.
After testing, emeditor works normally. You can also comment out install. the last two lines of BAT statement, so that emeditor will not be associated with the system. The above steps are performed on Windows 2000, and the same are true for Win9x, in addition, the emeditor configuration file in Win9x is the same as that in Windows 2000, except that the program version is different.
Copy the green emeditor to the USB flash drive. Run the install command directly when necessary. you can copy the BAT file (note that you need to run the batch file in the emeditor directory) without copying any files.
What is the. inf file?
. INF is the abbreviation of device information file. It is developed by Microsoft for hardware device manufacturers to release their device drivers. Many hardware drivers are used. .. INF files have been widely used since the Windows 3.x era.
The. inf file is a plain text file with a specific format. It can be said to be an installation script (setupscript ). Although. INF is only a plain text file, but when we are in the File Manager explorer on. right-click the INF file and right-click the INF file. PNG, the "Install I" command will appear on the right-click menu, because Microsoft has provided the Setup API (which can be explained) in its operating system windows. INF script file), we only need to use text editing software to write. INF file, you can complete most of the installation work, so especially when the Software size is not very large, the installation is not very complex, use. it is a good choice to install the INF file. And if you want to install the device driver, the. inf file is currently the only option. You can use the. inf file to create custom software installation commands including registry entries and target directories .. The inf file can provide limited platform independence and specify limited software dependencies. Currently. the most common application of the INF file is to install the driver of the hardware device. The purpose of this article is to introduce. the functions and structure of the INF file, and several examples are provided to illustrate how to use the file. INF file, how to expand. the purpose of the INF file, such as creating a green software, is for reference only.
The following is an example of a driver's. f file, usbinfpng.png, which is the USB stor. inf file I extracted from windows for the win98se USB storage device driver. It deletes most of the content and keeps a basic framework of the. inf file.
. Inf file format
You can see in Figure usbinfpng.png. the inf file is composed of multiple sections. the INI file is similar to the entire. the inf file consists of several sections. The section names are expanded in square brackets, such as the version section, the manufacturer section, and the strings section. Each section is composed of a series of entries. Each entry is composed of a key and a value. It is in the form of "Key = value, the items defined in these sections can complete automatic hardware detection and software (including drivers) installation .. The string following the semicolon in the INF file is a comment. In A. inf file, all text that follows the semicolon (;) will be considered as comments. Annotations do not have to start on a new line. You can add comments behind a line of text.
The format and function of the. inf file are as follows:
[Version] section: contains a brief description of this. inf file and information about the device types supported by this. inf file. Used to confirm the basic version information of the. inf file. Any. inf file must include this section.
In Figure usbinfpng.png, the statement Signature = "$ Chicago $" in [version] indicates this. INF files can be used on all platforms after Windows 95. Currently, they are Win98, winme, winnt4, Win2k, WINXP, and win2k3. This. inf file is common. If the signature entry in [version] Is Signature = "$ Windows 95 $", it indicates that this. inf file can be used on Win9x Platform after Windows 95. Currently, it is WIN98 and winme. If the signature entry in the [version] section is Signature = "$ Windows NT $", this. inf file can be used on WindowsNT platforms, including winnt4, Win2k, WINXP, and win2k3. Setupapi of the Win9x operating system rejects execution of this type of. inf file.
[Manufacturer] and [manufacturer name] sections: list all the hardware devices that can be identified by this. inf file, and list the vendor names for developing the hardware, which are mainly used for installation of hardware devices. The. inf file of the device driver must include the [manufacturer] and [manufacturer name] sections. In the image usbinfpng.png, the [manufacturer] and [Microsoft] sections are displayed. The vendor name and device name listed in the installation wizard are from these two sections. The name on the right of the equal sign "% mfgname % = Microsoft" in this line indicates that the device manufacturer is Microsoft, and the manufacturer name is on the left of the equal sign, the vendor name in the figure is "Microsoft" (in [Strings] Later ). The. inf file contains the names of multiple device manufacturers, which must be placed in the [manufacturer] section. In addition, the [manufacturer name] section can list multiple devices of the vendor. The [manufacturer name] section describes the devices to be installed and specifies the [install] section for the devices to be installed. [Manufacturer name] section Syntax:
[Manufacturer-name]
Device-description = install-section-name, device-ID [, compatible-device-id]...
Device-description is the description of the device to be installed. Install-section-name is the name of the [install] section of the device. The name of the manufacturer-name section must be defined in the [manufacturer] section. Device-ID is the hardware identifier of the device. Different hardware of each manufacturer corresponds to different device identifier.
This line of statement "% genericbulkonly. devicedesc % = usbstor_bulk, USB/class_08 & subclass_02 & prot_50 ", the device name is" USB mass storage device ", the USB/class_08 & subclass_02 & prot_50 on the right of the equal sign is the device identifier. This identifier corresponds to a type of hardware device, which is a USB storage device. The operating system detects the USB storage device, when the driver is installed, the driver is installed from the [usbstor_bulk] section of the device driver installation section. It can be seen that this. inf file can be used to install the driver of the general USB storage device "USB Mass Storage Device.
For general software installation. the inf file does not include the [manufacturer] and [manufacturer name] sections. Even if they are included, they are not executed. These two sections are used only for the hardware device driver.
[Install] section: Describes the actual properties of device drivers and hardware devices. It also defines the names of all [install] sections, which contain information and commands for installing the device. By default, the [defainstall install] section is executed. In Figure INF right-click. PNG, the install operation will execute the [defainstall install] section. The [defainstall install] section contains pointers to other sections. This section can be used to specify the files to be copied and deleted, registry updates, and. inf file updates.
In the image usbinfpng.png, [install] is the [usbstor_bulk] section. copy the file copyfiles and add the registry project addreg2.
For general software installation. INF file. You can right-click the "Install" command on the menu to install it (Figure INF right-click. PNG. the inf file must include the [defainstall install] section, or other [install] sections. Use rundll32.exe setupapi. DLL, installhinfsection [install] section name, such as a command to install.
Syntax of the [install] section:
[Install-section-name]
Copyfiles = file-list-Section [, file-list-section]...
Logconfig = Log-config-section-name
Renfiles = file-list-Section [, file-list-section]...
Delfiles = file-list-Section [, file-list-section]...
Updateinis = Update-ini-Section [, update-ini-section]...
Updateinifields = Update-inifields-Section [, update-inifields-section]...
Addreg = add-registry-Section [, add-registry-section]...
Delreg = del-registry-Section [, Del-registry-section]...
Ini2reg = ini-to-registry-Section [, ini-to-registry-section]...
Updatecfgsys = Update-config-Section
Updateautobat = Update-autoexec-Section
The [install] section defines the resources required for installation programs and hardware drivers to install new drivers or software. Each entry in this section has its specific format and meaning. Not all entries are necessary. Whether you are installing the driver or common software, you must start from a [install] section.
[Destinationdirs]: Specifies the location (for example,/Windows or Windows/system) for copying, deleting, or renaming a file on a hard disk ). The. inf file uses the [destinationdirs] section to specify the target path of the operation. The syntax is as follows:
[Destinationdirs]
File-list-Section = ldid [, subdir]
Defaultdestdir = ldid [, subdir]
The [destinationdirs] section defines the target directory of the operation (copyfiles, renfiles, or delfiles) specified in the [file-list-section] section. The defaultdestdir command can specify the default target folder for any copyfiles, renfiles, or delfiles file not explicitly named in the [destinationdirs] section in the. inf file.
In the. inf file, use the Logical Disk identifier (ldid) to represent the path, as shown in the following table:
00 null ldid-used to create a new ldid
01 source drive:/pathname
10 Windows folder (equivalent to % WINDIR % directory)
11 system folder
12 iosubsys folder
13 command folder
17. inf folder
18. Help folder
20 Fonts
21 viewers
22 vmm32
23. Color folder
24. root directory of the drive containing the Windows folder
28 host winboot
30. root folder of the boot disk
31. root folder of the master drive of the virtual boot disk
In usbinfpng.png, this line of statement is "usbstor. copylist = 10, system32/drivers "indicates usbstor. in the copylist file list, the target path of the file is % WINDIR %/system32/drivers. 10 indicates the folder where windows is located, that is, usbstor. copylist file list file usbstor. sys will be copied to the % WINDIR %/system32/drivers folder when installing the driver. The usbstor. inf file will be copied to 17, that is, the % WINDIR %/INF folder.
[Strings] section: defines and lists the localized strings used above. If a specific string appears frequently in the. inf file, defining a string variable for them in this section will be a good choice. In usbinfpng.png, the statement mfgname = "Microsoft" defines the mfgname variable (the string "Microsoft") used in the [manufacturer] section ").
[Filecopy/delete/renamesection (s)] section: lists the files to be copied, deleted, or renamed. The Section names are copyfiles, delfiles, and renfiles.
[Registryupdatesection (s)]: Specifies the project to be added or deleted in the registry. The section name is addreg and delreg.
[Inifileupdatesection (s)]: Specifies the update of the. ini file. The link will be created in this section. The section name is updateinis.
[Classinstall]: defines a new class for the device ). It is mainly used for installation of hardware devices.
[Sourcedisksnames] section: Lists disks containing files.
[Sourcedisksfiles] section: lists the disks on which each file is located.
There are many other sections, such as update. INI fields section (updateinifields), add INI file to registry section (ini2reg), update config. sys section (updatecfgsys), update autoexec. bat section (updateautobat), optional components section, and so on.
. The inf file is a script file interpreted and executed by the setupapi of windows. It runs in a simple and linear way. there is no branch statement in the running process of the INF file, that is, there is no conditional statement. Once executed, it is run along a fixed route. It runs in units of nodes. It starts from a [install] section and runs entries in this section from top to bottom. If this entry is a section, execute the entries in the subsection one by one, so that they are recursively executed.
This script looks very weak, but it is sufficient for simple installation tasks. For installation, copy the file, add the registry, and modify it. INI files and other tasks, which can be used. INF file. For more complex installation requirements, such as requiring the installation program to have a beautiful and convenient interface, requiring selective installation, and requiring the installation program to automatically repair functions, you have to turn to other tools, for example, Microsoft Windows Installer has more powerful functions.
. Inf file version
The syntax of the. inf file is a unified sub-section syntax. With the update of the operating system, Microsoft gradually adds some necessary keywords, but the structure of the entire. inf file will not change. Syntactically, The. inf file is a class.
According to the version of the. inf file, there are two types:
1 advancedinf. In the [version] section, "advancedinf = 2.5," You need a new version of advpack. DLL "" indicates this. the inf file requires advpack. the dynamic link library of DLL is used to explain the execution. advancedinf has some advanced features, but it is not used much currently.
2. Common INF. The advpack is not specified. DLL. INF file, use setupapi. DLL to explain the execution (the operating system of the Win9x series uses setupx. DLL), which is the common INF by default in the system.
. Inf file Function
From the previous introduction, we can see that using the. inf file can complete the following functions:
1. Copy, delete, or rename a file.
2. add or delete a project in the registry.
3. Modify important system settings files (such as autoexec. bat, config. sys, And. INI ).
It seems that the first feature mentioned above can be used to process files in batches. BAT to complete, the second function can be through the registry file. reg to complete, the third function is currently not used much, not often processed. the INI file. In this case, it seems that the. inf file does not have much advantage. This is a problem. I will emphasize the application of. inf in these aspects, instead of carefully explaining the. inf syntax. The. inf file is better than other tools.
Use the. inf file to edit the Registry
The. inf file can edit and manipulate the registry. The corresponding commands are addreg and delreg. The syntax is as follows:
Addreg = add-registry-Section [, add-registry-section]...
[Add-registry-section]
Reg-root-string, [subkey], [value-name], [flag], [value]
The [add-registry-section] section defines the subkey or Value Name of the Registry to be added. You can set its value selectively.
Delreg = del-registry-Section [, Del-registry-section]...
[Del-registry-section]
Reg-root-string, subkey, [value-name]
The [del-registry-section] section defines whether to delete the subkey or value name value-name from the registry.
Sometimes some websites access the Internet, modify the IE homepage, and disable the Regedit tool. At this time, many people have to use other third-party tools, such as the magic rabbit, to restore the registry editing permission, in fact, this time only depends on. the inf file can restore the permission to use the Regedit tool.
Copy the following code to notepad and save it as jiereg. INF. Right-click it and select "Install (I.
[Version]
Signature = "$ Chicago $"
[Defainstall install]
Addreg = My. Add. Reg
[My. Add. Reg]
Hkcu, "software/Microsoft/Windows/CurrentVersion/policies/system", "disableregistrytools", 0x00010001, "0"
HKLM, "software/Microsoft/Windows/CurrentVersion/policies/system", "disableregistrytools", 0x00010001, "0"
Of course, other methods can also be used, and the principle is the same. Here we only demonstrate the purpose of the. inf file.
If you directly use the registry file, you may also encounter another drawback: The. reg file uses hexadecimal code to represent Unicode strings. The following two registry statements:
[HKEY_CURRENT_USER/software/Microsoft/Windows/CurrentVersion/Explorer/User Shell Folders]
"Cookies" = hex (2): 25, 00, 55, 00, 53,00, 45, 00, 52,00, 50, 00, 52,00, 4f, 00, 00, 4C, 25, 00, 5C, 00, 6f, 00, 6f, 00, 6B, 00, 00
[HKEY_LOCAL_MACHINE/system/CurrentControlSet/services/SoftEther]
"ImagePath" = hex (2):, 3A, 00, 5C, 00, 6f, 00, 6d,, 69, 00, 6C, 65, 00, 5C, 00, 6f, 00, 00, 00, 5C, hour, 00, 6f,, 00
The preceding two statements are difficult to read and modify. Manual modification is troublesome.
The "cookies" value is actually the Unicode representation of the "% USERPROFILE %/cookies" string.
The value of "ImagePath" is actually "D:/program files/SoftEther/softether.exe" Service
If the form of the. inf file is used, it is easy to understand:
[Version]
Signature = "$ Chicago $"
[Defainstall install]
Addreg = folders_addreg
[Folders_addreg]
Hkcu, "software/Microsoft/Windows/CurrentVersion/Explorer/User Shell Folders", "cookies", 0x00020000, "% USERPROFILE %/cookies"
HKLM, "system/CurrentControlSet/services/SoftEther", "ImagePath", 0x020000, "" D:/program files/SoftEther/softether.exe "" service"
In this case, you can manually modify the path information, but the. reg file is difficult to do this.
Use the. inf file to edit the. ini file.
You can use the updateinis command to modify the. ini file. The updateinis syntax is as follows:
Updateinis = Update-ini-Section [, update-ini-section]...
[Update-ini-section-name]
Ini-file, ini-section, [old-ini-entry], [New-ini-entry], [flags]
All the entries in the. inf file replaced, deleted, or added in the [update-ini-section-name] section.
Ini-file contains the. ini file name of the entry to be modified. Ini-section contains the name of the node for which you want to change the entry. (Optional) old-ini-entry. The common format is key = value. New-ini-entry (Optional). The common format is key = value. Flags are optional operation tags.
By using the Logical Disk identifier (ldid), you can easily modify the path information in the. ini file. Of course, other entries are the same. For example: Total commander is an excellent file administrator, which contains various compression and decompression tools similar to NC, in addition to common features such as copying, deleting, moving, and editing, FTP features (with resume and background transmission) and Chinese garbled characters are also solved, "topic" will no longer become "color question", new file segmentation, file merging, file encoding, file decoding (MIME, UUE, XXE) and the new operation interface (floating tool column ). A really powerful tool that can completely replace the File Manager.
Total Commander relies on wincmd. ini to configure the corresponding operation features and functions, so you can use the following. inf file to modify the path information in wincmd. ini:
[Version]
Signature = "$ Chicago $"
[Defainstall install]
Addreg = addghister
Updateinis = updateinicmd
[Addghister]
Hkcu, "software/ghisler/total commander", "inifilename", 0, ". // wincmd. ini"
Hkcu, "software/ghisler/total commander", "ftpininame", 0, ". // wcx_ftp.ini"
[Updateinicmd]
% 01%/wincmd. ini, configuration, "installdir = % 01%"
% 01%/wincmd. ini, configuration, "mainmenu = % 01%/Language/tcextmenu. MNU"
The [addghister] Section is responsible for modifying wincmd records in the registry. INI path, while [updateinicmd] is responsible for modifying wincmd. the corresponding path information of the INI file is red. It can be seen that it is a simple. the inf file completes the task of modifying the path of total commander. In total commander5.x, you must modify wincmd. the path information in the INI file. the inf file is very convenient.
Use the. inf file to delete a file in use
Sometimes some files cannot be deleted because they are being used by the operating system. For example, some OCX controls for resource managers can be used. delete the delfiles command of the INF file. If the file to be deleted is found to be locked, the file will be placed in the system deletion queue, waiting for the system to restart, the file is automatically deleted.
The delfiles syntax is:
Delfiles = file-list-Section [, file-list-section]...
[File-list-section]
Filename, 1
The [file-list-section] section defines the list of files to be deleted. The 1 mark after filename indicates that if the file cannot be deleted currently, it will be deleted after the system restarts. .
[Version]
Signature = "$ Chicago $"
[Destinationdirs]
Defaultdestdir = 01; the current directory defines the path of the file to be deleted
[Defainstall install]
Delfiles = deletelist
[Deletelist]
Setup.exe, 1; object to be deleted
Setup2.exe, 1; object to be deleted
You can also use the copyfiles command to replace the files being accessed by the system. These functions cannot be implemented through Common del and copy commands. If you do not use the. inf file, you must use third-party software.
Auxiliary production of green software
In the registry. variables cannot be used in the reg file. This defect is critical to the installation program that needs to set the path ,. the paths in the reg file are static. Once written, they will not change with the system. If you need to change the installed program from drive C to drive D. if the installation path is recorded in the reg file, directly import the Registry file. reg does not work. The imported registry is still the original written path. In the. inf file, you can use variables to manipulate the path and track the changes in the path required by the installation program.
For the production of green software, you can refer to another special article I wrote-the production of green software. The core point is to get the Registry changes made by the original software installation program, then export the change to a registry file. reg for further analysis. If the exported. reg file does not include an absolute path, you can package the Registry file and extracted software into a green software. If. the reg file contains the absolute installation path of the current software, so you must manually modify the path in the registry every time. This is very troublesome and reduces the significance of making the Software green. Using the. inf file and the addreg command can easily solve the difficulty of the Registry path.
For the installation and production of green software, the most important thing is 01, that is, the source folder. The following is an example:
Registry crawler v4.5 is a powerful tool for users and developers to quickly locate and configure the registry. A powerful search engine allows you to search for Registration Information Based on search criteria. (You can download the http://www4.skycn.com/soft/2963.html from the sky software station), the Registry exported after installation contains the following statement:
[HKEY_LOCAL_MACHINE/software/4 developers/rcrawler/apppath]
@ = "F: // tools // Reg // rcrawler"
Where "F:/tools/REG/rcrawler" is the installation path.
The file changed to the. inf file is:
[Version]
Signature = "$ Chicago $"
[Defainstall install]
Addreg = add
[Add]
HKLM, "software/4 developers/rcrawler/apppath", "", 0, "% 01%"
Note that % 01% represents the current installation path.
When we move the files in the directory F:/tools/REG/rcrawler to another directory, we need to use. if you use the reg file method, you must manually modify the Registry file and use the previous one. you do not need to modify anything when using the INF file. You only need to right-click the file manager Explorer to execute the "Install" command, % 01% is automatically replaced with the current directory.
Finally, the Registry file. reg is very convenient and intuitive, but it is very clumsy and inconvenient to handle path changes. INF is not as intuitive as the registry file, but it can easily process path information (including Unicode path information. reg file and. INF files are used in combination to compensate for their respective shortcomings.
. Inf file generation method
Secret to automatically convert the. reg file to the. inf file, and then modify the corresponding path to replace the absolute path with the path represented by the Logical Disk identifier (ldid.
If file operations are involved, you have to write them manually. Currently, there is no automated tool.
The advantage of INF files is that they are not as powerful as vbs, and may even be caused by dangerous formatting code.
Strong INF restrictions, which is more secure than other script files. Of course, the relative functions are weak, but they are enough.
All of the above are my experience in using the. inf file and some learning experiences. You are welcome to come up with different opinions and opinions for discussion.