[PATCH 0/2] MR7127: msi: Set features to absent if advertising is disallowed.
From: Elizabeth Figura <zfigura(a)codeweavers.com> --- dlls/msi/tests/package.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index f7d9f57857d..5b9f800ddff 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -5283,6 +5283,12 @@ static void test_featureparents(void) /* msidbFeatureAttributesUIDisallowAbsent */ add_feature_entry( hdb, "'lyra', '', '', '', 2, 1, '', 16" ); + /* msidbFeatureAttributesDisallowAdvertise */ + add_feature_entry( hdb, "'cygnus', '', '', '', 2, 1, '', 8" ); + + /* advertise allowed */ + add_feature_entry( hdb, "'lacerta', '', '', '', 2, 1, '', 0" ); + /* disabled because of install level */ add_feature_entry( hdb, "'waters', '', '', '', 15, 101, '', 9" ); @@ -5378,6 +5384,8 @@ static void test_featureparents(void) test_feature_states( __LINE__, hpkg, "perseus", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_SOURCE, FALSE ); test_feature_states( __LINE__, hpkg, "orion", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_LOCAL, FALSE ); test_feature_states( __LINE__, hpkg, "lyra", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_LOCAL, FALSE ); + test_feature_states( __LINE__, hpkg, "cygnus", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_LOCAL, FALSE ); + test_feature_states( __LINE__, hpkg, "lacerta", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_LOCAL, FALSE ); test_feature_states( __LINE__, hpkg, "waters", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE ); test_feature_states( __LINE__, hpkg, "bayer", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE ); @@ -5402,10 +5410,18 @@ static void test_featureparents(void) r = MsiSetFeatureStateA(hpkg, "nosuchfeature", INSTALLSTATE_ABSENT); ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r); + r = MsiSetFeatureStateA(hpkg, "cygnus", INSTALLSTATE_ADVERTISED); + todo_wine ok(!r, "got %d\n", r); + + r = MsiSetFeatureStateA(hpkg, "lacerta", INSTALLSTATE_ADVERTISED); + ok(!r, "got %d\n", r); + test_feature_states( __LINE__, hpkg, "zodiac", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_LOCAL, FALSE ); test_feature_states( __LINE__, hpkg, "perseus", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_SOURCE, FALSE ); test_feature_states( __LINE__, hpkg, "orion", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ABSENT, FALSE ); test_feature_states( __LINE__, hpkg, "lyra", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ABSENT, FALSE ); + test_feature_states( __LINE__, hpkg, "cygnus", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ABSENT, TRUE ); + test_feature_states( __LINE__, hpkg, "lacerta", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ADVERTISED, FALSE ); test_feature_states( __LINE__, hpkg, "waters", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE ); test_feature_states( __LINE__, hpkg, "bayer", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7127
From: Elizabeth Figura <zfigura(a)codeweavers.com> Do not return an error. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50398 --- dlls/msi/install.c | 5 ++++- dlls/msi/tests/package.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index f4db3b510f1..286443d5bcd 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -925,7 +925,10 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE if (iState == INSTALLSTATE_ADVERTISED && feature->Attributes & msidbFeatureAttributesDisallowAdvertise) - return ERROR_FUNCTION_FAILED; + { + TRACE("Advertising is disallowed; making feature absent\n"); + iState = INSTALLSTATE_ABSENT; + } feature->ActionRequest = iState; diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 5b9f800ddff..e43894b5c81 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -5411,7 +5411,7 @@ static void test_featureparents(void) ok( r == ERROR_UNKNOWN_FEATURE, "Expected ERROR_UNKNOWN_FEATURE, got %u\n", r); r = MsiSetFeatureStateA(hpkg, "cygnus", INSTALLSTATE_ADVERTISED); - todo_wine ok(!r, "got %d\n", r); + ok(!r, "got %d\n", r); r = MsiSetFeatureStateA(hpkg, "lacerta", INSTALLSTATE_ADVERTISED); ok(!r, "got %d\n", r); @@ -5420,7 +5420,7 @@ static void test_featureparents(void) test_feature_states( __LINE__, hpkg, "perseus", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_SOURCE, FALSE ); test_feature_states( __LINE__, hpkg, "orion", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ABSENT, FALSE ); test_feature_states( __LINE__, hpkg, "lyra", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ABSENT, FALSE ); - test_feature_states( __LINE__, hpkg, "cygnus", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ABSENT, TRUE ); + test_feature_states( __LINE__, hpkg, "cygnus", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ABSENT, FALSE ); test_feature_states( __LINE__, hpkg, "lacerta", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_ADVERTISED, FALSE ); test_feature_states( __LINE__, hpkg, "waters", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE ); test_feature_states( __LINE__, hpkg, "bayer", ERROR_SUCCESS, INSTALLSTATE_ABSENT, INSTALLSTATE_UNKNOWN, FALSE ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7127
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7127
participants (3)
-
Elizabeth Figura -
Elizabeth Figura (@zfigura) -
Hans Leidekker (@hans)