Hans Leidekker : msi: Only create environment strings when the component is set to be installed.

Alexandre Julliard julliard at winehq.org
Tue Mar 2 10:32:34 CST 2010


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Mar  2 14:55:31 2010 +0100

msi: Only create environment strings when the component is set to be installed.

---

 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);
 




More information about the wine-cvs mailing list