Commit 424e3a9f authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Move the component enabled check into the standard actions.

parent 568c7c19
...@@ -824,6 +824,12 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -824,6 +824,12 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
if ( !comp ) if ( !comp )
continue; continue;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
continue;
}
feature = cls->Feature; feature = cls->Feature;
if (!feature) if (!feature)
continue; continue;
...@@ -976,6 +982,12 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) ...@@ -976,6 +982,12 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
if (!comp) if (!comp)
continue; continue;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
continue;
}
feature = cls->Feature; feature = cls->Feature;
if (!feature) if (!feature)
continue; continue;
...@@ -1250,6 +1262,12 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) ...@@ -1250,6 +1262,12 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
if (!ext->Component) if (!ext->Component)
continue; continue;
if (!ext->Component->Enabled)
{
TRACE("component is disabled\n");
continue;
}
feature = ext->Feature; feature = ext->Feature;
if (!feature) if (!feature)
continue; continue;
...@@ -1354,6 +1372,12 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package ) ...@@ -1354,6 +1372,12 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
if (!ext->Component) if (!ext->Component)
continue; continue;
if (!ext->Component->Enabled)
{
TRACE("component is disabled\n");
continue;
}
feature = ext->Feature; feature = ext->Feature;
if (!feature) if (!feature)
continue; continue;
......
...@@ -66,7 +66,7 @@ static void schedule_install_files(MSIPACKAGE *package) ...@@ -66,7 +66,7 @@ static void schedule_install_files(MSIPACKAGE *package)
LIST_FOR_EACH_ENTRY(file, &package->files, MSIFILE, entry) LIST_FOR_EACH_ENTRY(file, &package->files, MSIFILE, entry)
{ {
if (file->Component->ActionRequest != INSTALLSTATE_LOCAL) if (file->Component->ActionRequest != INSTALLSTATE_LOCAL || !file->Component->Enabled)
{ {
TRACE("File %s is not scheduled for install\n", debugstr_w(file->File)); TRACE("File %s is not scheduled for install\n", debugstr_w(file->File));
...@@ -501,6 +501,12 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param ) ...@@ -501,6 +501,12 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
if (!comp) if (!comp)
return ERROR_SUCCESS; return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
if (comp->ActionRequest != INSTALLSTATE_LOCAL && comp->ActionRequest != INSTALLSTATE_SOURCE) if (comp->ActionRequest != INSTALLSTATE_LOCAL && comp->ActionRequest != INSTALLSTATE_SOURCE)
{ {
TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); TRACE("Component not scheduled for installation: %s\n", debugstr_w(component));
...@@ -693,6 +699,12 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param) ...@@ -693,6 +699,12 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
if (!comp) if (!comp)
return ERROR_SUCCESS; return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
if (comp->ActionRequest != INSTALLSTATE_LOCAL) if (comp->ActionRequest != INSTALLSTATE_LOCAL)
{ {
TRACE("Component not scheduled for installation %s\n", debugstr_w(component)); TRACE("Component not scheduled for installation %s\n", debugstr_w(component));
...@@ -775,6 +787,12 @@ static UINT ITERATE_RemoveDuplicateFiles( MSIRECORD *row, LPVOID param ) ...@@ -775,6 +787,12 @@ static UINT ITERATE_RemoveDuplicateFiles( MSIRECORD *row, LPVOID param )
if (!comp) if (!comp)
return ERROR_SUCCESS; return ERROR_SUCCESS;
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
if (comp->ActionRequest != INSTALLSTATE_ABSENT) if (comp->ActionRequest != INSTALLSTATE_ABSENT)
{ {
TRACE("Component not scheduled for removal %s\n", debugstr_w(component)); TRACE("Component not scheduled for removal %s\n", debugstr_w(component));
...@@ -888,6 +906,12 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param) ...@@ -888,6 +906,12 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
if (!comp->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
if (!verify_comp_for_removal(comp, install_mode)) if (!verify_comp_for_removal(comp, install_mode))
{ {
TRACE("Skipping removal due to missing conditions\n"); TRACE("Skipping removal due to missing conditions\n");
...@@ -972,6 +996,12 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package ) ...@@ -972,6 +996,12 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
file->Component->Installed == INSTALLSTATE_SOURCE ) file->Component->Installed == INSTALLSTATE_SOURCE )
continue; continue;
if (!file->Component->Enabled)
{
TRACE("component is disabled\n");
continue;
}
if (file->Version) if (file->Version)
{ {
ver = msi_get_disk_file_version( file->TargetPath ); ver = msi_get_disk_file_version( file->TargetPath );
......
...@@ -196,6 +196,12 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param) ...@@ -196,6 +196,12 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
if (!file->Component->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
if (file->Component->ActionRequest != INSTALLSTATE_LOCAL) if (file->Component->ActionRequest != INSTALLSTATE_LOCAL)
{ {
TRACE("Component not scheduled for installation\n"); TRACE("Component not scheduled for installation\n");
...@@ -274,6 +280,12 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param ) ...@@ -274,6 +280,12 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param )
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
if (!file->Component->Enabled)
{
TRACE("component is disabled\n");
return ERROR_SUCCESS;
}
if (file->Component->ActionRequest != INSTALLSTATE_ABSENT) if (file->Component->ActionRequest != INSTALLSTATE_ABSENT)
{ {
TRACE("Component not scheduled for removal\n"); TRACE("Component not scheduled for removal\n");
......
...@@ -5760,8 +5760,8 @@ static void test_publish(void) ...@@ -5760,8 +5760,8 @@ static void test_publish(void)
/* UnpublishFeatures, only feature removed. Only works when entire product is removed */ /* UnpublishFeatures, only feature removed. Only works when entire product is removed */
r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature"); r = MsiInstallProductA(msifile, "UNPUBLISH_FEATURES=1 REMOVE=feature");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine ok(pf_exists("msitest\\maximus"), "File deleted\n"); ok(pf_exists("msitest\\maximus"), "File deleted\n");
todo_wine ok(pf_exists("msitest"), "Directory deleted\n"); ok(pf_exists("msitest"), "Directory deleted\n");
state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); state = MsiQueryProductState("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state); ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment