From ccdf578ba264bd8f522fc03188064b57003d220a Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Thu, 1 Nov 2007 03:14:18 -0500 Subject: [PATCH] msi: Only unpublish the features if the entire product is being uninstalled. --- dlls/msi/action.c | 15 ++++++++++++++- dlls/msi/tests/install.c | 10 ++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index ca46448698c..9560c4e9499 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3754,11 +3754,24 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature) return ERROR_SUCCESS; } +static BOOL msi_check_unpublish(MSIPACKAGE *package) +{ + MSIFEATURE *feature; + + LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) + { + if (feature->ActionRequest != INSTALLSTATE_ABSENT) + return FALSE; + } + + return TRUE; +} + static UINT ACTION_UnpublishFeatures(MSIPACKAGE *package) { MSIFEATURE *feature; - if (msi_check_publish(package)) + if (!msi_check_unpublish(package)) return ERROR_SUCCESS; LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index a93b66b52ed..6ac44f19a27 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -2169,16 +2169,10 @@ static void test_publish(void) ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); state = MsiQueryFeatureState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}", "montecristo"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);