[WINESYNC] msi: Fix installing from administrative image with compressed source files.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49352
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 15c8e5dee6fa3b7eac1d1b3cd6d27aa744faff4d by Hans Leidekker <hans@codeweavers.com>
This commit is contained in:
winesync 2022-03-13 19:08:35 +01:00 committed by Mark Jansen
parent 1c0e89646f
commit 5c7b97165c
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
2 changed files with 61 additions and 7 deletions

View file

@ -1230,10 +1230,9 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
*/
if (package->WordCount & msidbSumInfoSourceTypeAdminImage)
{
file->IsCompressed = FALSE;
file->IsCompressed = package->WordCount & msidbSumInfoSourceTypeCompressed;
}
else if (file->Attributes &
(msidbFileAttributesCompressed | msidbFileAttributesPatchAdded))
else if (file->Attributes & (msidbFileAttributesCompressed | msidbFileAttributesPatchAdded))
{
file->IsCompressed = TRUE;
}
@ -1241,10 +1240,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
{
file->IsCompressed = FALSE;
}
else
{
file->IsCompressed = package->WordCount & msidbSumInfoSourceTypeCompressed;
}
else file->IsCompressed = package->WordCount & msidbSumInfoSourceTypeCompressed;
load_file_hash(package, file);
load_file_disk_id(package, file);

View file

@ -1392,6 +1392,34 @@ static const CHAR sr_custom_action_dat[] =
"sourcedir_unset\t19\t\tSourceDir should not be set\n"
"sourcedir_set\t19\t\tSourceDir should be set\n";
static const CHAR ai2_file_dat[] =
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
"File\tFile\n"
"five.txt\tFive\tfive.txt\t1000\t\t\t0\t5\n"
"four.txt\tFour\tfour.txt\t1000\t\t\t0\t4\n";
static const CHAR ai2_component_dat[] =
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
"Component\tComponent\n"
"Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
"Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n";
static const CHAR ai2_feature_dat[] =
"Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
"s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
"Feature\tFeature\n"
"Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
"Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n";
static const CHAR ai2_feature_comp_dat[] =
"Feature_\tComponent_\n"
"s38\ts72\n"
"FeatureComponents\tFeature_\tComponent_\n"
"Five\tFive\n"
"Four\tFour\n";
static const msi_table tables[] =
{
ADD_TABLE(component),
@ -1821,6 +1849,18 @@ static const msi_table ai_tables[] =
ADD_TABLE(property)
};
static const msi_table ai2_tables[] =
{
ADD_TABLE(ai2_component),
ADD_TABLE(directory),
ADD_TABLE(ai2_feature),
ADD_TABLE(ai2_feature_comp),
ADD_TABLE(ai2_file),
ADD_TABLE(install_exec_seq),
ADD_TABLE(media),
ADD_TABLE(property)
};
static const msi_table pc_tables[] =
{
ADD_TABLE(ca51_component),
@ -4865,6 +4905,24 @@ static void test_adminimage(void)
delete_pf_files();
create_file("four.txt", 100);
create_file("five.txt", 100);
create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
create_database_wordcount(msifile, ai2_tables, ARRAY_SIZE(ai2_tables),
100, msidbSumInfoSourceTypeAdminImage|msidbSumInfoSourceTypeCompressed,
";1033", "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
ok(delete_pf("msitest", FALSE), "Directory not created\n");
error:
DeleteFileA("msifile");
DeleteFileA("msitest\\cabout\\new\\five.txt");