SetupInitializeFileLog
The SetupInitializeFileLog function initializes a file to record installation operations and outcomes. This can be the system log, where the system tracks the files installed as part of Windows NT, or any other file.
HSPFILELOG SetupInitializeFileLog(
PCTSTR LogFileName, // optional, name of a log file to use
DWORD Flags // controls initialization
);
Parameters
-
LogFileName
-
This optional parameter supplies the filename of the file to use as the log file. The LogFileName parameter must be specified if Flags does not include SPFILELOG_SYSTEMLOG. The LogFileName parameter must not be specified if Flags includes SPFILELOG_SYSTEMLOG.
-
Flags
-
A set of flags that controls the log file initialization. This parameter can be a combination of the following:
-
SPFILELOG_SYSTEMLOG
-
Use the Windows NT system file log which is used to track what files are installed as part of Windows NT. The user must be Administrator to specify this option unless SPFILELOG_QUERYONLY is specified and LogFileName is not specified. Do not specify SPFILELOG_SYSTEMLOG in combination with SPFILELOG_FORCENEW.
-
SPFILELOG_FORCENEW
-
If the log file exits, overwrite it. If the log file exists and this flag is not specified, any new files that are installed are added to the list in the existing log file. Do not specify in combination with SPFILELOG_SYSTEMLOG.
-
SPFILELOG_QUERYONLY
-
Open the log file for querying only.
Return Values
The function returns the handle to the log file if it is successful. Otherwise, the the return value is INVALID_HANDLE_VALUE and the logged error can be retrieved by a call to GetLastError.
QuickInfo
Windows NT: Use version 4.0 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in setupapi.h.
Import Library: Link with setupapi.lib.
See Also
Overview, Functions, SetupTerminateFileLog, SetupLogFile