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.
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 @@
switch (comp->Attributes)
{
case msidbComponentAttributesLocalOnly:
- case msidbComponentAttributesOptional:
comp->Action = INSTALLSTATE_LOCAL;
comp->ActionRequest = INSTALLSTATE_LOCAL;
break;
@@ -1130,6 +1129,10 @@
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 @@
}
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;