Hans Leidekker : msi: Search all contexts in ACTION_GetComponentInstallStates.

Alexandre Julliard julliard at winehq.org
Thu Jan 20 12:41:22 CST 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Jan 20 09:06:19 2011 +0100

msi: Search all contexts in ACTION_GetComponentInstallStates.

---

 dlls/msi/action.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 8cf80bf..4bd5157 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1834,11 +1834,9 @@ static UINT ACTION_FileCost(MSIPACKAGE *package)
 static void ACTION_GetComponentInstallStates(MSIPACKAGE *package)
 {
     MSICOMPONENT *comp;
-    INSTALLSTATE state;
+    INSTALLSTATE state = MsiQueryProductStateW( package->ProductCode );
     UINT r;
 
-    state = MsiQueryProductStateW(package->ProductCode);
-
     LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
     {
         if (!comp->ComponentId) continue;
@@ -1847,9 +1845,17 @@ static void ACTION_GetComponentInstallStates(MSIPACKAGE *package)
             comp->Installed = INSTALLSTATE_ABSENT;
         else
         {
-            r = MsiQueryComponentStateW(package->ProductCode, NULL,
-                                        package->Context, comp->ComponentId,
-                                        &comp->Installed);
+            r = MsiQueryComponentStateW( package->ProductCode, NULL,
+                                         MSIINSTALLCONTEXT_USERMANAGED, comp->ComponentId,
+                                         &comp->Installed );
+            if (r != ERROR_SUCCESS)
+                r = MsiQueryComponentStateW( package->ProductCode, NULL,
+                                             MSIINSTALLCONTEXT_USERUNMANAGED, comp->ComponentId,
+                                             &comp->Installed );
+            if (r != ERROR_SUCCESS)
+                r = MsiQueryComponentStateW( package->ProductCode, NULL,
+                                             MSIINSTALLCONTEXT_MACHINE, comp->ComponentId,
+                                             &comp->Installed );
             if (r != ERROR_SUCCESS)
                 comp->Installed = INSTALLSTATE_ABSENT;
         }




More information about the wine-cvs mailing list