mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 19:43:31 +08:00
[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.
This is import of Wine commit:
e830975806
Fixes MS Office 2000/2003 installers and probably others. CORE-17693
This commit is contained in:
parent
e8a7e0da2b
commit
63bb43adbb
@ -1498,6 +1498,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
|
||||
r = get_local_package( file, localfile );
|
||||
if (r != ERROR_SUCCESS || GetFileAttributesW( localfile ) == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
DWORD localfile_attr;
|
||||
|
||||
r = msi_create_empty_local_file( localfile, dotmsi );
|
||||
if (r != ERROR_SUCCESS)
|
||||
{
|
||||
@ -1514,6 +1516,11 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, 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);
|
||||
}
|
||||
TRACE("opening package %s\n", debugstr_w( localfile ));
|
||||
r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
|
||||
|
Loading…
Reference in New Issue
Block a user