James Hawkins : msi: Only set the action to source if the component has a local feature.
Alexandre Julliard
julliard at winehq.org
Mon Aug 25 06:20:49 CDT 2008
Module: wine
Branch: master
Commit: 9288055beb890629a89273d8afb71366be8099f4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9288055beb890629a89273d8afb71366be8099f4
Author: James Hawkins <jhawkins at codeweavers.com>
Date: Mon Aug 25 00:06:09 2008 -0500
msi: Only set the action to source if the component has a local feature.
---
dlls/msi/msipriv.h | 19 +++++++++--------
dlls/msi/tests/package.c | 50 +++++++++------------------------------------
2 files changed, 20 insertions(+), 49 deletions(-)
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index ec3a650..e6ce9da 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -33,6 +33,7 @@
#include "objidl.h"
#include "winnls.h"
#include "wine/list.h"
+#include "wine/debug.h"
#define MSI_DATASIZEMASK 0x00ff
#define MSITYPE_VALID 0x0100
@@ -912,16 +913,16 @@ static inline void msi_component_set_state( MSICOMPONENT *comp, INSTALLSTATE sta
}
else if (state == INSTALLSTATE_SOURCE)
{
- switch (comp->Installed)
+ if (comp->Installed == INSTALLSTATE_ABSENT ||
+ (comp->Installed == INSTALLSTATE_SOURCE && comp->hasLocalFeature))
{
- case INSTALLSTATE_ABSENT:
- case INSTALLSTATE_SOURCE:
- comp->ActionRequest = state;
- comp->Action = state;
- break;
- default:
- comp->ActionRequest = INSTALLSTATE_UNKNOWN;
- comp->Action = INSTALLSTATE_UNKNOWN;
+ comp->ActionRequest = state;
+ comp->Action = state;
+ }
+ else
+ {
+ comp->ActionRequest = INSTALLSTATE_UNKNOWN;
+ comp->Action = INSTALLSTATE_UNKNOWN;
}
}
else
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 2036e9d..d74c50f 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -3809,20 +3809,14 @@ static void test_states(void)
r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "zeta", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
@@ -5251,20 +5245,14 @@ 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_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "gamma", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
@@ -5285,20 +5273,14 @@ static void test_states(void)
r = MsiGetComponentState(hpkg, "epsilon", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "zeta", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
@@ -5333,20 +5315,14 @@ static void test_states(void)
r = MsiGetComponentState(hpkg, "mu", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "nu", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
@@ -5367,20 +5343,14 @@ static void test_states(void)
r = MsiGetComponentState(hpkg, "pi", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
r = MsiGetComponentState(hpkg, "rho", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
- todo_wine
- {
- ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
- }
+ ok( action == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;
More information about the wine-cvs
mailing list