James Hawkins : msi:
Follow state resolution rules when a feature parent saves a component.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Sep 28 07:35:45 CDT 2006
Module: wine
Branch: master
Commit: cabc7ee1ae327e4e29c3f9910498d83f48e56af7
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=cabc7ee1ae327e4e29c3f9910498d83f48e56af7
Author: James Hawkins <truiken at gmail.com>
Date: Wed Sep 27 19:37:06 2006 -0700
msi: Follow state resolution rules when a feature parent saves a component.
---
dlls/msi/helpers.c | 27 +++++++++++++++++++++++++--
dlls/msi/tests/package.c | 10 ++--------
2 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c
index d1664bf..868d737 100644
--- a/dlls/msi/helpers.c
+++ b/dlls/msi/helpers.c
@@ -33,6 +33,7 @@ #include "msipriv.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "action.h"
+#include "msidefs.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi);
@@ -892,8 +893,30 @@ void ACTION_UpdateComponentStates(MSIPAC
f->ActionRequest == INSTALLSTATE_SOURCE) )
{
TRACE("Saved by %s\n", debugstr_w(f->Feature));
- component->ActionRequest = f->ActionRequest;
- component->Action = f->ActionRequest;
+
+ if (component->Attributes & msidbComponentAttributesOptional)
+ {
+ if (f->Attributes & msidbFeatureAttributesFavorSource)
+ {
+ component->Action = INSTALLSTATE_SOURCE;
+ component->ActionRequest = INSTALLSTATE_SOURCE;
+ }
+ else
+ {
+ component->Action = INSTALLSTATE_LOCAL;
+ component->ActionRequest = INSTALLSTATE_LOCAL;
+ }
+ }
+ else if (component->Attributes & msidbComponentAttributesSourceOnly)
+ {
+ component->Action = INSTALLSTATE_SOURCE;
+ component->ActionRequest = INSTALLSTATE_SOURCE;
+ }
+ else
+ {
+ component->Action = INSTALLSTATE_LOCAL;
+ component->ActionRequest = INSTALLSTATE_LOCAL;
+ }
}
}
}
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 5ed8b5b..6542a25 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -2626,10 +2626,7 @@ static void test_featureparents(void)
r = MsiGetComponentState(hpkg, "virgo", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, 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;
@@ -2643,10 +2640,7 @@ static void test_featureparents(void)
r = MsiGetComponentState(hpkg, "cassiopeia", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
More information about the wine-cvs
mailing list