msi: Open the log file in shared write mode.
This commit is contained in:
parent
b32ed71ff5
commit
29ee65402b
|
@ -1775,12 +1775,12 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
|
||||||
lstrcpyW(gszLogFile,szLogFile);
|
lstrcpyW(gszLogFile,szLogFile);
|
||||||
if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
|
if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
|
||||||
DeleteFileW(szLogFile);
|
DeleteFileW(szLogFile);
|
||||||
file = CreateFileW(szLogFile, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS,
|
file = CreateFileW(szLogFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS,
|
||||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (file != INVALID_HANDLE_VALUE)
|
if (file != INVALID_HANDLE_VALUE)
|
||||||
CloseHandle(file);
|
CloseHandle(file);
|
||||||
else
|
else
|
||||||
ERR("Unable to enable log %s\n",debugstr_w(szLogFile));
|
ERR("Unable to enable log %s (%u)\n", debugstr_w(szLogFile), GetLastError());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
gszLogFile[0] = '\0';
|
gszLogFile[0] = '\0';
|
||||||
|
|
|
@ -1773,11 +1773,10 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
|
||||||
MsiCloseHandle( rec );
|
MsiCloseHandle( rec );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!rc) && (gszLogFile[0]) && !((eMessageType & 0xff000000) ==
|
if (!rc && gszLogFile[0] && (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
|
||||||
INSTALLMESSAGE_PROGRESS))
|
|
||||||
{
|
{
|
||||||
DWORD write;
|
DWORD write;
|
||||||
HANDLE log_file = CreateFileW(gszLogFile,GENERIC_WRITE, 0, NULL,
|
HANDLE log_file = CreateFileW(gszLogFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
|
||||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
|
||||||
if (log_file != INVALID_HANDLE_VALUE)
|
if (log_file != INVALID_HANDLE_VALUE)
|
||||||
|
|
Loading…
Reference in New Issue