Logging Errors

[This is preliminary documentation and subject to change.]

Windows NT Setup automatically logs errors returned by your migration DLL code. To log the errors your migration DLL detects, you must use the new Setup API SetupLogError function.

BOOL
SetupLogError(
    IN LPCTSTR MessageString,
    IN LogSeverity ErrorSeverity
    );

Parameters

MessageString
Error message string to be saved to the Windows NT Setup action log (saved to %Windir%SETUPACT.LOG).
ErrorSeverity
Specifies the severity of the error to be logged, and it can have one of the following values. The values are listed from lowest to highest severity.

Remarks

If ErrorSeverity level is LogSevWarning, LogSevError, or LogSevFatalError, a copy of the error message will also be saved to the %Windir%SETUPERR.LOG file.

Before logging an error, the log file must be opened using SetupOpenLog. SetupCloseLog must be used to close it after the error is written.

Note Opening and closing a log file can be done in the DLLMain function of a migration DLL. See sample source code for example.