James Hawkins : msi: If the feature linked to a component has a state of INSTALLSTATE_UNKNOWN, the component's state should match.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 26 15:04:58 CDT 2006


Module: wine
Branch: master
Commit: bbd4d1e3ef314098f1e7777629cb0bc7c347c330
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=bbd4d1e3ef314098f1e7777629cb0bc7c347c330

Author: James Hawkins <truiken at gmail.com>
Date:   Mon Sep 25 20:05:25 2006 -0700

msi: If the feature linked to a component has a state of INSTALLSTATE_UNKNOWN, the component's state should match.

---

 dlls/msi/action.c        |    5 +++++
 dlls/msi/tests/package.c |   48 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 037d509..49cba04 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1831,6 +1831,11 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *pa
                         component->ActionRequest = INSTALLSTATE_ABSENT;
                     }
                 }
+                else if (feature->ActionRequest == INSTALLSTATE_UNKNOWN)
+                {
+                    component->Action = INSTALLSTATE_UNKNOWN;
+                    component->ActionRequest = INSTALLSTATE_UNKNOWN;
+                }
             }
 
             if (component->ForceLocalState && feature->Action == INSTALLSTATE_SOURCE)
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 3b3a1e7..abf996f 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -2339,6 +2339,14 @@ static void test_featureparents(void)
     r = add_feature_entry( hdb, "'bayer', 'waters', '', '', 14, 1, '', 9" );
     ok( r == ERROR_SUCCESS, "cannot add feature: %d\n", r );
 
+    /* component of disabled feature (install level) */
+    r = add_component_entry( hdb, "'delphinus', '', 'TARGETDIR', 0, '', 'delphinus_file'" );
+    ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+
+    /* component of disabled child feature (install level) */
+    r = add_component_entry( hdb, "'hydrus', '', 'TARGETDIR', 0, '', 'hydrus_file'" );
+    ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
+
     /* msidbFeatureAttributesFavorLocal:msidbComponentAttributesLocalOnly */
     r = add_component_entry( hdb, "'leo', '', 'TARGETDIR', 0, '', 'leo_file'" );
     ok( r == ERROR_SUCCESS, "cannot add component: %d\n", r );
@@ -2419,6 +2427,12 @@ static void test_featureparents(void)
     r = add_feature_components_entry( hdb, "'orion', 'lepus'" );
     ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
 
+    r = add_feature_components_entry( hdb, "'waters', 'delphinus'" );
+    ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
+
+    r = add_feature_components_entry( hdb, "'bayer', 'hydrus'" );
+    ok( r == ERROR_SUCCESS, "cannot add feature components: %d\n", r );
+
     r = add_file_entry( hdb, "'leo_file', 'leo', 'leo.txt', 100, '', '1033', 8192, 1" );
     ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
 
@@ -2446,6 +2460,12 @@ static void test_featureparents(void)
     r = add_file_entry( hdb, "'lepus_file', 'lepus', 'lepus.txt', 0, '', '1033', 8192, 1" );
     ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
 
+    r = add_file_entry( hdb, "'delphinus_file', 'delphinus', 'delphinus.txt', 0, '', '1033', 8192, 1" );
+    ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
+
+    r = add_file_entry( hdb, "'hydrus_file', 'hydrus', 'hydrus.txt', 0, '', '1033', 8192, 1" );
+    ok( r == ERROR_SUCCESS, "cannot add file: %d\n", r);
+
     hpkg = package_from_db( hdb );
     ok( hpkg, "failed to create package\n");
 
@@ -2556,6 +2576,20 @@ static void test_featureparents(void)
     ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
     ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
 
+    state = 0xdeadbee;
+    action = 0xdeadbee;
+    r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
+    ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
+    ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
+    ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
+
+    state = 0xdeadbee;
+    action = 0xdeadbee;
+    r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
+    ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
+    ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
+    ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
+
     r = MsiSetFeatureState(hpkg, "orion", INSTALLSTATE_ABSENT);
     ok( r == ERROR_SUCCESS, "failed to set feature state: %d\n", r);
 
@@ -2657,6 +2691,20 @@ static void test_featureparents(void)
     {
         ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
     }
+
+    state = 0xdeadbee;
+    action = 0xdeadbee;
+    r = MsiGetComponentState(hpkg, "delphinus", &state, &action);
+    ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
+    ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
+    ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
+
+    state = 0xdeadbee;
+    action = 0xdeadbee;
+    r = MsiGetComponentState(hpkg, "hydrus", &state, &action);
+    ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
+    ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
+    ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
     
     MsiCloseHandle(hpkg);
 }




More information about the wine-cvs mailing list