msi: Fix installations with only INSTALLSTATE_SOURCE features.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2017-10-18 17:25:08 +02:00 committed by Alexandre Julliard
parent 02c35582f6
commit 30c957b9cc
2 changed files with 17 additions and 2 deletions

View File

@ -4315,7 +4315,7 @@ static BOOL msi_check_publish(MSIPACKAGE *package)
LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry)
{
feature->Action = msi_get_feature_action( package, feature );
if (feature->Action == INSTALLSTATE_LOCAL)
if (feature->Action == INSTALLSTATE_LOCAL || feature->Action == INSTALLSTATE_SOURCE)
return TRUE;
}
@ -5358,7 +5358,7 @@ static BOOL is_full_uninstall( MSIPACKAGE *package )
LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
{
if (feature->Action == INSTALLSTATE_LOCAL) ret = FALSE;
if (feature->Action == INSTALLSTATE_LOCAL || feature->Action == INSTALLSTATE_SOURCE) ret = FALSE;
}
features = msi_split_string( remove, ',' );

View File

@ -3654,6 +3654,21 @@ static void test_states(void)
MsiCloseHandle(hpkg);
/* test source only install */
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "one");
ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "two");
ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state);
r = MsiInstallProductA(msifile, "ADDSOURCE=one");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "one");
ok(state == INSTALLSTATE_SOURCE, "state = %d\n", state);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "two");
ok(state == INSTALLSTATE_ABSENT, "state = %d\n", state);
/* uninstall the product */
r = MsiInstallProductA(msifile4, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);