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

This commit is contained in:
Hans Leidekker 2010-03-02 14:55:31 +01:00 committed by Alexandre Julliard
parent a64372ca44
commit c8308ef99d
1 changed files with 15 additions and 1 deletions

View File

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