rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 Filename.inf in Visual Studio .NET

Creating ECC200 in Visual Studio .NET rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 Filename.inf

rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 Filename.inf
Make Data Matrix In .NET
Using Barcode creation for ASP.NET Control to generate, create DataMatrix image in ASP.NET applications.
www.OnBarcode.com
Generate Bar Code In .NET
Using Barcode creation for ASP.NET Control to generate, create barcode image in ASP.NET applications.
www.OnBarcode.com
Listing 9 1 shows a simple INF file. The first section, [Version], is required. The name of the second section is arbitrary but usually [DefaultInstall] so that users can right click the file to install it. The linkage to this section is through the command line you saw just before this paragraph. The command is rundll32.exe, which executes the API in Setupapi.dll called InstallHinfSection. The next item on the command line, DefaultInstall, is the name of the section to install. The 132 you see before the file name tells the setup API to prompt the user before rebooting the computer, if necessary. The last item on the command line is the name of the INF file to install. Like I mentioned, because this is the command that Windows XP associates with the .inf file extension, you should usually name this section [DefaultInstall]. Within this section you see two directives, AddReg and DelReg. The directive AddReg=Add.Settings adds the settings contained in the section [Add.Settings]. Listing 9 1: Example.inf
Data Matrix ECC200 Printer In C#.NET
Using Barcode generator for .NET framework Control to generate, create ECC200 image in Visual Studio .NET applications.
www.OnBarcode.com
ECC200 Generator In VS .NET
Using Barcode maker for Visual Studio .NET Control to generate, create Data Matrix image in Visual Studio .NET applications.
www.OnBarcode.com
[Version] Signature=$CHICAGO$ [DefaultInstall] AddReg=Add.Settings DelReg=Del.Settings [Add.Settings] HKCR,regfile\shell,,0,"edit" [Del.Settings] HKCU,Software\Microsoft\Windows\CurrentVersion\Applets\Regedit
Data Matrix ECC200 Creation In Visual Basic .NET
Using Barcode maker for VS .NET Control to generate, create Data Matrix 2d barcode image in .NET applications.
www.OnBarcode.com
Code 128 Encoder In VS .NET
Using Barcode printer for ASP.NET Control to generate, create Code 128C image in ASP.NET applications.
www.OnBarcode.com
The directive DelReg=Del.Settings deletes the settings listed in the section [Del.Settings]. The names of these sections are arbitrary; you should adopt names that make sense to you and stick with them so you don't confuse yourself down the road. Now you've had my two dollar tour of an INF file. The sections that follow describe how to write the different parts of an INF file. I'm focusing on using INF files to edit the registry, but you can do much more with them. The ultimate resource for writing INF files is http://msdn.microsoft.com/library/en us/install/hh/install/inf format_7soi.asp on Microsoft's Web site. This is the INF File Sections and Directives section of the Windows Driver Development Kit (DDK). Don't let the fact that this information is in the DDK scare you; it's really straightforward and useful for much more than installing device drivers.
DataMatrix Generator In Visual Studio .NET
Using Barcode printer for ASP.NET Control to generate, create DataMatrix image in ASP.NET applications.
www.OnBarcode.com
Bar Code Encoder In .NET
Using Barcode generation for ASP.NET Control to generate, create bar code image in ASP.NET applications.
www.OnBarcode.com
Starting with a Template
Creating 1D In .NET
Using Barcode drawer for ASP.NET Control to generate, create 1D image in ASP.NET applications.
www.OnBarcode.com
Barcode Generation In VS .NET
Using Barcode creator for ASP.NET Control to generate, create bar code image in ASP.NET applications.
www.OnBarcode.com
I never start INF files from scratch. I can't be bothered to remember the format of the sections and directives, so I use a template. I'm lazy enough (or efficient enough) that I add the template you see in Listing 9 2 to the Templates folder in my user profile so that I can right click in a folder, and then click New, Setup Information File. The easiest way is to first create the file Setup Information File.inf with the contents of Listing 9 2. Then use Tweak UI, which you learn about in 5, "Mapping Tweak UI," to add the template. It's a real timesaver. Listing 9 2: Setup Information File.inf
Printing Matrix 2D Barcode In .NET
Using Barcode maker for ASP.NET Control to generate, create Matrix 2D Barcode image in ASP.NET applications.
www.OnBarcode.com
RM4SCC Creation In Visual Studio .NET
Using Barcode encoder for ASP.NET Control to generate, create British Royal Mail 4-State Customer Code image in ASP.NET applications.
www.OnBarcode.com
[Version] Signature=$CHICAGO$
EAN13 Recognizer In VB.NET
Using Barcode reader for VS .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
Paint QR Code JIS X 0510 In VB.NET
Using Barcode creator for VS .NET Control to generate, create QR Code ISO/IEC18004 image in Visual Studio .NET applications.
www.OnBarcode.com
[DefaultInstall] BitReg=Bits.Set AddReg=Reg.Settings AddReg=Reg.Uninstall CopyFiles=Inf.Copy [DefaultUninstall] BitReg=Bits.Clear DelReg=Reg.Settings DelReg=Reg.Uninstall DelFiles=Inf.Copy [Reg.Settings] ; ROOT,SUBKEY[,NAME[,FLAG[,DATA]]] ; ; FLAG: ; ; 0x00000 REG_SZ ; 0x00001 REG_BINARY ; 0x10000 REG_MULTI_SZ ; 0x20000 REG_EXPAND_SZ ; 0x10001 REG_DWORD ; 0x20001 REG_NONE [Bits.Set] ; ROOT,SUBKEY,NAME,FLAG,MASK,BYTE ; ; FLAG: ; ; 0x00000 Clear bits in mask ; 0x00001 Set bits in mask [Bits.Clear] ; ROOT,SUBKEY,NAME,FLAG,MASK,BYTE ; ; FLAG: ; ; 0x00000 Clear bits in mask ; 0x00001 Set bits in mask [Reg.Uninstall] HKCU,Software\Microsoft\Windows\CurrentVersion\Uninstall\%NAME% HKCU,Software\Microsoft\Windows\CurrentVersion\Uninstall\%NAME%,DisplayName\ ,,"%NAME%" HKCU,Software\Microsoft\Windows\CurrentVersion\Uninstall\%NAME%,UninstallString\ ,,"Rundll32.exe setupapi.dll,InstallHinfSection DefaultUninstall 132"\ " %53%\Application Data\Custom\FILENAME" ; ROOT: ; ; HKCU ; HKLM [Inf.Copy] FILENAME [DestinationDirs] Inf.Copy=53,Application Data\Custom
Generating Barcode In Objective-C
Using Barcode generator for iPhone Control to generate, create barcode image in iPhone applications.
www.OnBarcode.com
Code 39 Recognizer In .NET
Using Barcode recognizer for .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
; DIRID: ; ; 10 %SystemRoot% ; 11 %SystemRoot%\System32 ; 17 %SystemRoot%\Inf ; 53 %UserProfile% ; 54 %SystemDrive% ; 1 Absolute path [SourceDisksNames] 55=%DISKNAME% [SourceDisksFiles] FILENAME=55 [Strings] NAME = "Jerry's NAME" DISKNAME = "Setup Files"
PDF 417 Printer In C#
Using Barcode creation for VS .NET Control to generate, create PDF417 image in .NET applications.
www.OnBarcode.com
Bar Code Generation In .NET Framework
Using Barcode generation for Reporting Service Control to generate, create barcode image in Reporting Service applications.
www.OnBarcode.com
The reason this template makes creating INF files so easy is because I've added comments to it. Comments begin with the semicolon (;) and add descriptive information to the file. In this case, for each section, I described the format of the different directives. In the [Reg.Settings] section, for example, you see the syntax for adding values to the registry. In the [Bits.Set] section, you see the format for setting individual bits in a number. I often write INF files that users can uninstall using Add Or Remove Programs; the template in Listing 9 2 shows you how to do that. If you don't want users to uninstall the file and its settings, remove the [DefaultUninstall], [Reg.Uninstall], [Inf.Copy],[DestinationDirs], [SourceDisksNames], and [SourceDisksFiles] sections and any linkages to those sections. In this template, all capitalized words are placeholders that I replace when I create an INF file. For example, I replace FILENAME with the INF file's actual name. The first two lines in Listing 9 2 are the only ones required. The [Version] section and the Signature property identify the file as a valid INF file. You must include these two lines at the top of all your INF files. Incidentally, Chicago was Microsoft's code name for Microsoft Windows 95, and so version=$CHICAGO$ identifies the file as a Windows 95 INF file. These days, $CHICAGO$ indicates an INF file that's compatible with all versions of Windows. Use $Windows 95$ if you want to indicate that your INF file is compatible with 16 bit versions of Windows only. Use $Windows NT$ to indicate that your INF file is compatible with 32 bit versions of Windows only. Generally, I leave Signature set to $CHICAGO$.
Making DataMatrix In Objective-C
Using Barcode generator for iPhone Control to generate, create Data Matrix ECC200 image in iPhone applications.
www.OnBarcode.com
Printing Code39 In Java
Using Barcode generation for Java Control to generate, create Code 39 image in Java applications.
www.OnBarcode.com
Copyright © OnBarcode.com . All rights reserved.