Reading writing INF files

  • Thread starter Thread starter tensai
  • Start date Start date
T

tensai

Hi,

i was wondering if there was either a commercial or open source .NET
library available for reading / writing INF files.

the file is the following format ..to give an idea of what i'm going on
about

--------------------START--------------

[Heading1]
Key1,Value1
Key2,Value2

[Heading2]
Key3,Value3
Key4,Value4


-----------------END--------------------

Cheers

himanshu
 
There's a tool called "GenINF" in the Windows DDK.

But as far as I remember the DDK is no longer available for public download
and now require MSDN subscription to download it.

Maybe you can find another way to get it.
 
Err... I misread the question.

You can use the following APIs (quoted from the Windows DDK):
Function Description
InstallHinfSection Executes a specified section in a specified INF
file.
SetupCloseInfFile Frees resources and closes the INF handle.
SetupCopyOEMInf Copies a file into %windir%\Inf.
SetupDecompressOrCopyFile Copies a file and, if necessary,
decompresses it.
SetupFindFirstLine Finds a pointer to the first line in a section of
an INF file or, if a key is specified, the first line that matches the key.
SetupFindNextLine Returns a pointer to the next line in an INF file
section.
SetupFindNextMatchLine Returns a pointer to the next line in an INF
file section or, if a key is specified, the next line that matches the key.
SetupGetBinaryField Retrieves binary data from a field in a specified
line, in an INF file.
SetupGetFieldCount Returns the number of fields in a line.
SetupGetFileCompressionInfo Retrieves file compression information
from an INF file.
SetupGetInfFileList Returns a list of the INF files in a specified
directory.
SetupGetInfInformation Returns information about an INF file.
SetupGetIntField Obtains the integer value of a specified field in a
specified line, in an INF file.
SetupGetLineByIndex Returns a pointer to the line associated with a
specified index value in a specified section.
SetupGetLineCount Returns the number of lines in the specified
section.
SetupGetLineText Retrieves the contents of a specified line from an
INF file.
SetupGetMultiSzField Returns multiple strings, starting at a specified
field in a line.
SetupGetSourceFileLocation Returns the location of a source file
listed in an INF file.
SetupGetSourceFileSize Returns the size of a specified file or a set
of files listed in a specified section of an INF file.
SetupGetSourceInfo Retrieves the path, tag file, or description for a
source.
SetupGetStringField Retrieves string data from a field in a specified
line, in an INF file.
SetupGetTargetPath Determines the target path for the files listed in
a specified INF file section.
SetupInstallFile Installs a specified file into a specific target
directory.
SetupInstallFileEx Installs a specified file into a specific target
directory. The installation is postponed if an existing version of the file
is in use.
SetupInstallFilesFromInfSection Queues the files in a specified INF
file section for copying. (Same as SetupQueueCopySection.)
SetupInstallFromInfSection Performs the directives specified in an INF
DDInstall section.
SetupInstallServicesFromInfSection Performs service installation and
deletion operations as specified in an INF DDInstall.Services section.
SetupOpenAppendInfFile Opens an INF file and appends it to an existing
INF handle.
SetupOpenInfFile Opens an INF file and returns a handle to it.
SetupOpenMasterInf Opens the master INF file that contains file and
layout information for files shipped with the operating system.
SetupQueryInfFileInformation Returns the name of one of the
constituent INF files of a specified INF file.
SetupQueryInfVersionInformation Returns the version number of one of
the constituent INF files of a specified INF file.
SetupSetDirectoryId Assigns a directory ID (DIRID) to a specified
directory.
SetupUninstallOEMInf Uninstalls a specified INF file, and deletes the
associated .pnf and .cat files, if they exist.
SetupVerifyInfFile Verifies that a digitally-signed INF file has not
been modified. (Windows XP and later.)


For detailed function descriptions, see the Platform SDK documentation.

tensai said:
Hi,

i was wondering if there was either a commercial or open source .NET
library available for reading / writing INF files.

the file is the following format ..to give an idea of what i'm going on
about

--------------------START--------------

[Heading1]
Key1,Value1
Key2,Value2

[Heading2]
Key3,Value3
Key4,Value4


-----------------END--------------------

Cheers

himanshu
 
Back
Top