msi: Skip the feature action detection logic if there is no product code.

This commit is contained in:
James Hawkins 2008-08-25 00:07:18 -05:00 committed by Alexandre Julliard
parent c855fbfcd8
commit d596ae29d8
6 changed files with 28 additions and 23 deletions

View File

@ -1327,7 +1327,7 @@ static UINT load_feature(MSIRECORD * row, LPVOID param)
feature->Attributes = MSI_RecordGetInteger(row,8);
feature->Installed = INSTALLSTATE_UNKNOWN;
msi_feature_set_state( feature, INSTALLSTATE_UNKNOWN );
msi_feature_set_state(package, feature, INSTALLSTATE_UNKNOWN);
list_add_tail( &package->features, &feature->entry );
@ -1754,7 +1754,7 @@ static BOOL process_state_property(MSIPACKAGE* package, int level,
continue;
if (strcmpiW(override,all)==0)
msi_feature_set_state( feature, state );
msi_feature_set_state(package, feature, state);
else
{
LPWSTR ptr = override;
@ -1765,7 +1765,7 @@ static BOOL process_state_property(MSIPACKAGE* package, int level,
if ((ptr2 && strncmpW(ptr,feature->Feature, ptr2-ptr)==0)
|| (!ptr2 && strcmpW(ptr,feature->Feature)==0))
{
msi_feature_set_state(feature, state);
msi_feature_set_state(package, feature, state);
break;
}
if (ptr2)
@ -1841,11 +1841,11 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package)
if ((feature_state) && (feature->Action == INSTALLSTATE_UNKNOWN))
{
if (feature->Attributes & msidbFeatureAttributesFavorSource)
msi_feature_set_state( feature, INSTALLSTATE_SOURCE );
msi_feature_set_state(package, feature, INSTALLSTATE_SOURCE);
else if (feature->Attributes & msidbFeatureAttributesFavorAdvertise)
msi_feature_set_state( feature, INSTALLSTATE_ADVERTISED );
msi_feature_set_state(package, feature, INSTALLSTATE_ADVERTISED);
else
msi_feature_set_state( feature, INSTALLSTATE_LOCAL );
msi_feature_set_state(package, feature, INSTALLSTATE_LOCAL);
}
}
@ -1858,7 +1858,7 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package)
continue;
LIST_FOR_EACH_ENTRY( fl, &feature->Children, FeatureList, entry )
msi_feature_set_state( fl->feature, INSTALLSTATE_UNKNOWN );
msi_feature_set_state(package, fl->feature, INSTALLSTATE_UNKNOWN);
}
}
else
@ -1891,7 +1891,7 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package)
cl->component->ForceLocalState &&
feature->Action == INSTALLSTATE_SOURCE)
{
msi_feature_set_state( feature, INSTALLSTATE_LOCAL );
msi_feature_set_state(package, feature, INSTALLSTATE_LOCAL);
break;
}
}
@ -5736,7 +5736,8 @@ static BOOL init_functionpointers(void)
return TRUE;
}
static UINT install_assembly(MSIASSEMBLY *assembly, LPWSTR path)
static UINT install_assembly(MSIPACKAGE *package, MSIASSEMBLY *assembly,
LPWSTR path)
{
IAssemblyCache *cache;
HRESULT hr;
@ -5745,7 +5746,7 @@ static UINT install_assembly(MSIASSEMBLY *assembly, LPWSTR path)
TRACE("installing assembly: %s\n", debugstr_w(path));
if (assembly->feature)
msi_feature_set_state(assembly->feature, INSTALLSTATE_LOCAL);
msi_feature_set_state(package, assembly->feature, INSTALLSTATE_LOCAL);
if (assembly->manifest)
FIXME("Manifest unhandled\n");
@ -5905,7 +5906,7 @@ static BOOL installassembly_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
{
assembly->installed = TRUE;
r = install_assembly(assembly, temppath);
r = install_assembly(package, assembly, temppath);
if (r != ERROR_SUCCESS)
ERR("Failed to install assembly\n");
}
@ -5970,7 +5971,7 @@ static UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package )
{
lstrcpyW(path, assembly->file->SourcePath);
r = install_assembly(assembly, path);
r = install_assembly(package, assembly, path);
if (r != ERROR_SUCCESS)
ERR("Failed to install assembly\n");
}

View File

@ -1909,7 +1909,7 @@ msi_seltree_menu( HWND hwnd, HTREEITEM hItem )
case INSTALLSTATE_LOCAL:
case INSTALLSTATE_ADVERTISED:
case INSTALLSTATE_ABSENT:
msi_feature_set_state( feature, r );
msi_feature_set_state(package, feature, r);
break;
default:
FIXME("select feature and all children\n");

View File

@ -180,7 +180,7 @@ static UINT ControlEvent_AddLocal(MSIPACKAGE* package, LPCWSTR argument,
else
{
LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
msi_feature_set_state( feature, INSTALLSTATE_LOCAL );
msi_feature_set_state(package, feature, INSTALLSTATE_LOCAL);
ACTION_UpdateComponentStates(package,argument);
}
@ -200,7 +200,7 @@ static UINT ControlEvent_Remove(MSIPACKAGE* package, LPCWSTR argument,
else
{
LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
msi_feature_set_state( feature, INSTALLSTATE_ABSENT );
msi_feature_set_state(package, feature, INSTALLSTATE_ABSENT);
ACTION_UpdateComponentStates(package,argument);
}
@ -220,7 +220,7 @@ static UINT ControlEvent_AddSource(MSIPACKAGE* package, LPCWSTR argument,
else
{
LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
msi_feature_set_state( feature, INSTALLSTATE_SOURCE );
msi_feature_set_state(package, feature, INSTALLSTATE_SOURCE);
ACTION_UpdateComponentStates(package,argument);
}
return ERROR_SUCCESS;

View File

@ -774,7 +774,7 @@ UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE* package, LPCWSTR szFeature,
feature->Attributes & msidbFeatureAttributesDisallowAdvertise)
return ERROR_FUNCTION_FAILED;
msi_feature_set_state( feature, iState );
msi_feature_set_state(package, feature, iState);
ACTION_UpdateComponentStates(package,szFeature);

View File

@ -854,9 +854,16 @@ extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action, UIN
extern void ACTION_FinishCustomActions( const MSIPACKAGE* package);
extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, UINT script, BOOL execute);
static inline void msi_feature_set_state( MSIFEATURE *feature, INSTALLSTATE state )
static inline void msi_feature_set_state(MSIPACKAGE *package,
MSIFEATURE *feature,
INSTALLSTATE state)
{
if (state == INSTALLSTATE_ABSENT)
if (!package->ProductCode)
{
feature->ActionRequest = state;
feature->Action = state;
}
else if (state == INSTALLSTATE_ABSENT)
{
switch (feature->Installed)
{

View File

@ -5926,10 +5926,7 @@ static void test_featureparents(void)
r = MsiGetFeatureState(hpkg, "orion", &state, &action);
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
ok( state == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", state);
todo_wine
{
ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
}
ok( action == INSTALLSTATE_ABSENT, "Expected orion INSTALLSTATE_ABSENT, got %d\n", action);
state = 0xdeadbee;
action = 0xdeadbee;