Mike McCormack : msi: Split ACTION_UpdateInstallStates into two separate functions.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 30 05:22:18 CST 2006


Module: wine
Branch: master
Commit: b76691537ffec8914137cc4e0d3fcb78d5a64633
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b76691537ffec8914137cc4e0d3fcb78d5a64633

Author: Mike McCormack <mike at codeweavers.com>
Date:   Mon Oct 30 16:35:09 2006 +0900

msi: Split ACTION_UpdateInstallStates into two separate functions.

---

 dlls/msi/action.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index e7ba6a2..7cfd74d 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1592,15 +1592,10 @@ static MSIFOLDER *load_folder( MSIPACKAG
     return folder;
 }
 
-/* scan for and update current install states */
-static void ACTION_UpdateInstallStates(MSIPACKAGE *package)
+static void ACTION_GetComponentInstallStates(MSIPACKAGE *package)
 {
     MSICOMPONENT *comp;
-    MSIFEATURE *feature;
 
-    /* FIXME: component's installed state should be determined
-     * by the component's registration
-     */
     LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
     {
         INSTALLSTATE res;
@@ -1608,12 +1603,19 @@ static void ACTION_UpdateInstallStates(M
         if (!comp->ComponentId)
             continue;
 
-        res = MsiGetComponentPathW( package->ProductCode, 
+        res = MsiGetComponentPathW( package->ProductCode,
                                     comp->ComponentId, NULL, NULL);
         if (res < 0)
             res = INSTALLSTATE_ABSENT;
         comp->Installed = res;
     }
+}
+
+/* scan for and update current install states */
+static void ACTION_UpdateFeatureInstallStates(MSIPACKAGE *package)
+{
+    MSICOMPONENT *comp;
+    MSIFEATURE *feature;
 
     LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
     {
@@ -1972,6 +1974,9 @@ static UINT ACTION_CostFinalize(MSIPACKA
         msiobj_release(&view->hdr);
     }
 
+    /* read components states from the registry */
+    ACTION_GetComponentInstallStates(package);
+
     TRACE("File calculations\n");
 
     LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
@@ -2053,7 +2058,7 @@ static UINT ACTION_CostFinalize(MSIPACKA
         MSI_SetPropertyW(package,szlevel, szOne);
     msi_free(level);
 
-    ACTION_UpdateInstallStates(package);
+    ACTION_UpdateFeatureInstallStates(package);
 
     return MSI_SetFeatureStates(package);
 }




More information about the wine-cvs mailing list