mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00: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: https://source.winehq.org/git/wine.git/commit/e830975806df9ef283c89f7153b06b145dfb2cec Fixes MS Office 2000/2003 installers and probably others. CORE-17693
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user