[02/11] msi: Only create environment strings when the component is set to be installed.

Hans Leidekker hans at codeweavers.com
Tue Mar 2 07:55:31 CST 2010


---
 dlls/msi/action.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 0569cc7..6ff4c67 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -5702,13 +5702,14 @@ static LONG env_set_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags )
 static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
 {
     MSIPACKAGE *package = param;
-    LPCWSTR name, value;
+    LPCWSTR name, value, component;
     LPWSTR data = NULL, newval = NULL;
     LPWSTR deformatted = NULL, ptr;
     DWORD flags, type, size;
     LONG res;
     HKEY env = NULL, root;
     LPCWSTR environment;
+    MSICOMPONENT *comp;
 
     static const WCHAR user_env[] =
         {'E','n','v','i','r','o','n','m','e','n','t',0};
@@ -5719,6 +5720,19 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
          'S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r','\\',
          'E','n','v','i','r','o','n','m','e','n','t',0};
 
+    component = MSI_RecordGetString(rec, 4);
+    comp = get_loaded_component(package, component);
+    if (!comp)
+        return ERROR_SUCCESS;
+
+    if (comp->ActionRequest != INSTALLSTATE_LOCAL)
+    {
+        TRACE("Component not scheduled for installation: %s\n", debugstr_w(component));
+        comp->Action = comp->Installed;
+        return ERROR_SUCCESS;
+    }
+    comp->Action = INSTALLSTATE_LOCAL;
+
     name = MSI_RecordGetString(rec, 2);
     value = MSI_RecordGetString(rec, 3);
 
-- 
1.6.3.3





More information about the wine-patches mailing list