[07/10] msi: Fix the class actions to revert features to the installed state during rollback.

Hans Leidekker hans at codeweavers.com
Tue May 24 03:51:15 CDT 2011


---
 dlls/msi/action.c  |    6 ++++++
 dlls/msi/classes.c |   35 ++++++++++++++++-------------------
 dlls/msi/msipriv.h |    1 +
 3 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 27a9903..8e4f2e1 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -827,6 +827,12 @@ INSTALLSTATE msi_get_component_action( MSIPACKAGE *package, MSICOMPONENT *comp )
     return comp->ActionRequest;
 }
 
+INSTALLSTATE msi_get_feature_action( MSIPACKAGE *package, MSIFEATURE *feature )
+{
+    if (package->need_rollback) return feature->Installed;
+    return feature->ActionRequest;
+}
+
 static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
 {
     MSIPACKAGE *package = param;
diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c
index 7208006..cd73389 100644
--- a/dlls/msi/classes.c
+++ b/dlls/msi/classes.c
@@ -841,21 +841,20 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
         if (!feature)
             continue;
 
-        if (feature->ActionRequest != INSTALLSTATE_LOCAL &&
-            feature->ActionRequest != INSTALLSTATE_ADVERTISED )
+        feature->Action = msi_get_feature_action( package, feature );
+        if (feature->Action != INSTALLSTATE_LOCAL &&
+            feature->Action != INSTALLSTATE_ADVERTISED )
         {
-            TRACE("Feature %s not scheduled for installation, skipping registration of class %s\n",
+            TRACE("feature %s not scheduled for installation, skipping registration of class %s\n",
                   debugstr_w(feature->Feature), debugstr_w(cls->clsid));
             continue;
         }
-        feature->Action = feature->ActionRequest;
 
         if (!comp->KeyPath || !(file = msi_get_loaded_file( package, comp->KeyPath )))
         {
             TRACE("COM server not provided, skipping class %s\n", debugstr_w(cls->clsid));
             continue;
         }
-
         TRACE("Registering class %s (%p)\n", debugstr_w(cls->clsid), cls);
 
         cls->Installed = TRUE;
@@ -1005,14 +1004,13 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
         if (!feature)
             continue;
 
-        if (feature->ActionRequest != INSTALLSTATE_ABSENT)
+        feature->Action = msi_get_feature_action( package, feature );
+        if (feature->Action != INSTALLSTATE_ABSENT)
         {
-            TRACE("Feature %s not scheduled for removal, skipping unregistration of class %s\n",
+            TRACE("feature %s not scheduled for removal, skipping unregistration of class %s\n",
                   debugstr_w(feature->Feature), debugstr_w(cls->clsid));
             continue;
         }
-        feature->Action = feature->ActionRequest;
-
         TRACE("Unregistering class %s (%p)\n", debugstr_w(cls->clsid), cls);
 
         cls->Installed = FALSE;
@@ -1288,15 +1286,14 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
          * yes. MSDN says that these are based on _Feature_ not on
          * Component.  So verify the feature is to be installed
          */
-        if (feature->ActionRequest != INSTALLSTATE_LOCAL &&
-            !(install_on_demand && feature->ActionRequest == INSTALLSTATE_ADVERTISED))
+        feature->Action = msi_get_feature_action( package, feature );
+        if (feature->Action != INSTALLSTATE_LOCAL &&
+            !(install_on_demand && feature->Action == INSTALLSTATE_ADVERTISED))
         {
-            TRACE("Feature %s not scheduled for installation, skipping registration of extension %s\n",
-                   debugstr_w(feature->Feature), debugstr_w(ext->Extension));
+            TRACE("feature %s not scheduled for installation, skipping registration of extension %s\n",
+                  debugstr_w(feature->Feature), debugstr_w(ext->Extension));
             continue;
         }
-        feature->Action = feature->ActionRequest;
-
         TRACE("Registering extension %s (%p)\n", debugstr_w(ext->Extension), ext);
 
         ext->Installed = TRUE;
@@ -1394,13 +1391,13 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
         if (!feature)
             continue;
 
-        if (feature->ActionRequest != INSTALLSTATE_ABSENT)
+        feature->Action = msi_get_feature_action( package, feature );
+        if (feature->Action != INSTALLSTATE_ABSENT)
         {
-            TRACE("Feature %s not scheduled for removal, skipping unregistration of extension %s\n",
-                   debugstr_w(feature->Feature), debugstr_w(ext->Extension));
+            TRACE("feature %s not scheduled for removal, skipping unregistration of extension %s\n",
+                  debugstr_w(feature->Feature), debugstr_w(ext->Extension));
             continue;
         }
-
         TRACE("Unregistering extension %s\n", debugstr_w(ext->Extension));
 
         ext->Installed = FALSE;
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 4e2e312..ab53113 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -773,6 +773,7 @@ extern UINT MSI_SetFeatureStates( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
 extern UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case ) DECLSPEC_HIDDEN;
 extern UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action ) DECLSPEC_HIDDEN;
 extern INSTALLSTATE msi_get_component_action( MSIPACKAGE *package, MSICOMPONENT *comp ) DECLSPEC_HIDDEN;
+extern INSTALLSTATE msi_get_feature_action( MSIPACKAGE *package, MSIFEATURE *feature ) DECLSPEC_HIDDEN;
 
 /* record internals */
 extern void MSI_CloseRecord( MSIOBJECTHDR * ) DECLSPEC_HIDDEN;
-- 
1.7.4.1







More information about the wine-patches mailing list