MsiEnableLogW function (msi.h)
The MsiEnableLog function sets the log mode for all subsequent installations that are initiated in the calling process.
Syntax
UINT MsiEnableLogW(
[in] DWORD dwLogMode,
[in] LPCWSTR szLogFile,
[in] DWORD dwLogAttributes
);
Parameters
[in] dwLogMode
Specifies the log mode. This parameter can be one or more of the following values.
[in] szLogFile
Specifies the string that holds the full path to the log file. Entering a null disables logging, in which case dwlogmode is ignored. If a path is supplied, then dwlogmode must not be zero.
[in] dwLogAttributes
Specifies how frequently the log buffer is to be flushed.
Value | Meaning |
---|---|
|
If this value is set, the installer appends the existing log specified by szLogFile. If not set, any existing log specified by szLogFile is overwritten. |
|
Forces the log buffer to be flushed after each line. If this value is not set, the installer flushes the log buffer after 20 lines by calling FlushFileBuffers. |
Return value
Value | Meaning |
---|---|
|
An invalid log mode was specified. |
|
The function succeeded. |
Remarks
For a description of the Logging policy, see System Policy.
The path to the log file location must already exist when using this function. The Installer does not create the directory structure for the log file.
Note
The msi.h header defines MsiEnableLog as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version. |
Target Platform | Windows |
Header | msi.h |
Library | Msi.lib |
DLL | Msi.dll |