Commit f84fa0ce authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Fix the compressed files logic.

If the compressed file attribute is not set, use the Word Count property to determine if files are compressed.
parent 8f6de4af
...@@ -1326,8 +1326,24 @@ static UINT load_file(MSIRECORD *row, LPVOID param) ...@@ -1326,8 +1326,24 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
file->state = msifs_invalid; file->state = msifs_invalid;
/* if the compressed bits are not set in the file attributes,
* then read the information from the package word count property
*/
if (file->Attributes & msidbFileAttributesCompressed) if (file->Attributes & msidbFileAttributesCompressed)
{ {
file->IsCompressed = TRUE;
}
else if (file->Attributes & msidbFileAttributesNoncompressed)
{
file->IsCompressed = FALSE;
}
else
{
file->IsCompressed = package->WordCount & MSIWORDCOUNT_COMPRESSED;
}
if (file->IsCompressed)
{
file->Component->ForceLocalState = TRUE; file->Component->ForceLocalState = TRUE;
file->Component->Action = INSTALLSTATE_LOCAL; file->Component->Action = INSTALLSTATE_LOCAL;
file->Component->ActionRequest = INSTALLSTATE_LOCAL; file->Component->ActionRequest = INSTALLSTATE_LOCAL;
......
...@@ -120,6 +120,7 @@ typedef struct tagMSIFILE ...@@ -120,6 +120,7 @@ typedef struct tagMSIFILE
msi_file_state state; msi_file_state state;
LPWSTR SourcePath; LPWSTR SourcePath;
LPWSTR TargetPath; LPWSTR TargetPath;
BOOL IsCompressed;
} MSIFILE; } MSIFILE;
typedef struct tagMSITEMPFILE typedef struct tagMSITEMPFILE
......
...@@ -330,7 +330,7 @@ static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source, ...@@ -330,7 +330,7 @@ static BOOL extract_cabinet_file(MSIPACKAGE* package, LPCWSTR source,
static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, MSICOMPONENT* static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, MSICOMPONENT*
comp, LPCWSTR path) comp, LPCWSTR path)
{ {
if (!(file->Attributes & msidbFileAttributesCompressed)) if (!file->IsCompressed)
{ {
LPWSTR p, path; LPWSTR p, path;
p = resolve_folder(package, comp->Directory, TRUE, FALSE, NULL); p = resolve_folder(package, comp->Directory, TRUE, FALSE, NULL);
...@@ -419,7 +419,7 @@ static UINT ready_media_for_file( MSIPACKAGE *package, struct media_info *mi, ...@@ -419,7 +419,7 @@ static UINT ready_media_for_file( MSIPACKAGE *package, struct media_info *mi,
msi_free(mi->last_path); msi_free(mi->last_path);
mi->last_path = NULL; mi->last_path = NULL;
if (!(file->Attributes & msidbFileAttributesCompressed)) if (!file->IsCompressed)
{ {
mi->last_path = resolve_folder(package, comp->Directory, TRUE, FALSE, NULL); mi->last_path = resolve_folder(package, comp->Directory, TRUE, FALSE, NULL);
set_file_source(package,file,comp,mi->last_path); set_file_source(package,file,comp,mi->last_path);
...@@ -605,7 +605,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -605,7 +605,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
continue; continue;
/* compressed files are extracted in ready_media_for_file */ /* compressed files are extracted in ready_media_for_file */
if (file->Attributes & msidbFileAttributesCompressed) if (file->IsCompressed)
{ {
if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW(file->TargetPath)) if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW(file->TargetPath))
ERR("compressed file wasn't extracted (%s)\n", ERR("compressed file wasn't extracted (%s)\n",
......
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
#define MSITYPE_NULLABLE 0x1000 #define MSITYPE_NULLABLE 0x1000
#define MSITYPE_KEY 0x2000 #define MSITYPE_KEY 0x2000
/* Word Count masks */
#define MSIWORDCOUNT_SHORTFILENAMES 0x0001
#define MSIWORDCOUNT_COMPRESSED 0x0002
#define MSIWORDCOUNT_ADMINISTRATIVE 0x0004
#define MSIWORDCOUNT_PRIVILEGES 0x0008
#define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID)) #define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
struct tagMSITABLE; struct tagMSITABLE;
...@@ -223,6 +229,8 @@ typedef struct tagMSIPACKAGE ...@@ -223,6 +229,8 @@ typedef struct tagMSIPACKAGE
UINT CurrentInstallState; UINT CurrentInstallState;
msi_dialog *dialog; msi_dialog *dialog;
LPWSTR next_dialog; LPWSTR next_dialog;
UINT WordCount;
struct list subscriptions; struct list subscriptions;
} MSIPACKAGE; } MSIPACKAGE;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "shlobj.h" #include "shlobj.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "objbase.h" #include "objbase.h"
#include "msidefs.h"
#include "msipriv.h" #include "msipriv.h"
#include "action.h" #include "action.h"
...@@ -376,6 +377,34 @@ static VOID set_installer_properties(MSIPACKAGE *package) ...@@ -376,6 +377,34 @@ static VOID set_installer_properties(MSIPACKAGE *package)
ReleaseDC(0, dc); ReleaseDC(0, dc);
} }
static UINT msi_get_word_count( MSIPACKAGE *package )
{
UINT rc;
INT word_count;
MSIHANDLE suminfo;
MSIHANDLE hdb = alloc_msihandle( &package->db->hdr );
rc = MsiGetSummaryInformationW( hdb, NULL, 0, &suminfo );
MsiCloseHandle(hdb);
if (rc != ERROR_SUCCESS)
{
ERR("Unable to open Summary Information\n");
return 0;
}
rc = MsiSummaryInfoGetPropertyW( suminfo, PID_WORDCOUNT, NULL,
&word_count, NULL, NULL, NULL );
if (rc != ERROR_SUCCESS)
{
ERR("Unable to query word count\n");
MsiCloseHandle(suminfo);
return 0;
}
MsiCloseHandle(suminfo);
return word_count;
}
MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db ) MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
{ {
static const WCHAR szLevel[] = { 'U','I','L','e','v','e','l',0 }; static const WCHAR szLevel[] = { 'U','I','L','e','v','e','l',0 };
...@@ -411,6 +440,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db ) ...@@ -411,6 +440,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
list_init( &package->progids ); list_init( &package->progids );
list_init( &package->RunningActions ); list_init( &package->RunningActions );
package->WordCount = msi_get_word_count( package );
/* OK, here is where we do a slew of things to the database to /* OK, here is where we do a slew of things to the database to
* prep for all that is to come as a package */ * prep for all that is to come as a package */
......
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