James Hawkins : msi: Fix a couple install state test cases.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 1 04:57:36 CDT 2006


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

Author: James Hawkins <truiken at gmail.com>
Date:   Mon Jul 31 14:50:44 2006 -0700

msi: Fix a couple install state test cases.

- Correctly handle the msidbComponentAttributesOptional component attribute.
- Don't set a component's state to INSTALLSTATE_LOCAL if the
  msidbComponentAttributesSourceOnly attribute is provided.

---

 dlls/msi/action.c        |   19 +++++++++++++------
 dlls/msi/tests/package.c |   10 ++--------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 37513e0..65cfa77 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1122,7 +1122,6 @@ static UINT load_component( MSIRECORD *r
     switch (comp->Attributes)
     {
     case msidbComponentAttributesLocalOnly:
-    case msidbComponentAttributesOptional:
         comp->Action = INSTALLSTATE_LOCAL;
         comp->ActionRequest = INSTALLSTATE_LOCAL;
         break;
@@ -1130,6 +1129,10 @@ static UINT load_component( MSIRECORD *r
         comp->Action = INSTALLSTATE_SOURCE;
         comp->ActionRequest = INSTALLSTATE_SOURCE;
         break;
+    case msidbComponentAttributesOptional:
+        comp->Action = INSTALLSTATE_DEFAULT;
+        comp->ActionRequest = INSTALLSTATE_DEFAULT;
+        break;
     default:
         comp->Action = INSTALLSTATE_UNKNOWN;
         comp->ActionRequest = INSTALLSTATE_UNKNOWN;
@@ -1713,16 +1716,20 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *pa
             }
             else
             {
-                if (feature->Action == INSTALLSTATE_LOCAL)
+                if (feature->Attributes == msidbFeatureAttributesFavorLocal)
                 {
-                    component->Action = INSTALLSTATE_LOCAL;
-                    component->ActionRequest = INSTALLSTATE_LOCAL;
+                    if (!(component->Attributes & msidbComponentAttributesSourceOnly))
+                    {
+                        component->Action = INSTALLSTATE_LOCAL;
+                        component->ActionRequest = INSTALLSTATE_LOCAL;
+                    }
                 }
-                else if (feature->ActionRequest == INSTALLSTATE_SOURCE)
+                else if (feature->Attributes == msidbFeatureAttributesFavorSource)
                 {
                     if ((component->Action == INSTALLSTATE_UNKNOWN) ||
                         (component->Action == INSTALLSTATE_ABSENT) ||
-                        (component->Action == INSTALLSTATE_ADVERTISED))
+                        (component->Action == INSTALLSTATE_ADVERTISED) ||
+                        (component->Action == INSTALLSTATE_DEFAULT))
                            
                     {
                         component->Action = INSTALLSTATE_SOURCE;
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 24f4332..62920fa 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -1700,10 +1700,7 @@ static void test_states(void)
     r = MsiGetComponentState(hpkg, "beta", &state, &action);
     ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
     ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
-    todo_wine
-    {
-        ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
-    }
+    ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
 
     state = 0xdeadbee;
     action = 0xdeadbee;
@@ -1731,10 +1728,7 @@ static void test_states(void)
     r = MsiGetComponentState(hpkg, "zeta", &state, &action);
     ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
     ok( state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
-    todo_wine
-    {
-        ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
-    }
+    ok( action == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", action);
 
     state = 0xdeadbee;
     action = 0xdeadbee;




More information about the wine-cvs mailing list