Commit e8309758 authored by Jérôme Gardou's avatar Jérôme Gardou Committed by Alexandre Julliard

msi: Remove read-only bit when copying the package file.

CopyFileW also copies the file attributes, and the copy will be opened with write access later on. Signed-off-by: 's avatarJérôme Gardou <jerome.gardou@reactos.org> Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d6fed9c3
......@@ -1371,6 +1371,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
r = get_local_package( db, localfile );
if (r != ERROR_SUCCESS || GetFileAttributesW( localfile ) == INVALID_FILE_ATTRIBUTES)
{
DWORD localfile_attr;
r = msi_create_empty_local_file( localfile, L".msi" );
if (r != ERROR_SUCCESS)
{
......@@ -1387,6 +1389,11 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
return r;
}
delete_on_close = TRUE;
/* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
localfile_attr = GetFileAttributesW( localfile );
if (localfile_attr & FILE_ATTRIBUTE_READONLY)
SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
}
else if (dwOptions & WINE_OPENPACKAGEFLAGS_RECACHE)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment