From 0713f098ecf0b1d7d35b1343dfd0a61e37a7a75b Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Fri, 24 Jun 2005 11:51:29 +0000 Subject: [PATCH] Properly handle -1 as a registry key root. --- dlls/msi/action.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 80e1e8eced1..fb06127fbf0 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -1700,12 +1700,11 @@ static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param) LPCWSTR Condition; Condition = MSI_RecordGetString(row,3); - if (MSI_EvaluateConditionW(package,Condition) == - MSICONDITION_TRUE) + if (MSI_EvaluateConditionW(package,Condition) == MSICONDITION_TRUE) { int level = MSI_RecordGetInteger(row,2); - TRACE("Reseting feature %s to level %i\n", - debugstr_w(Feature), level); + TRACE("Reseting feature %s to level %i\n", debugstr_w(Feature), + level); package->features[feature_index].Level = level; } } @@ -1875,8 +1874,6 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package) return SetFeatureStates(package); } - - /* OK this value is "interpreted" and then formatted based on the first few characters */ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type, @@ -2056,6 +2053,23 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) /* get the root key */ switch (root) { + case -1: + { + static const WCHAR szALLUSER[] = {'A','L','L','U','S','E','R','S',0}; + LPWSTR all_users = load_dynamic_property(package, szALLUSER, NULL); + if (all_users && all_users[0] == '1') + { + root_key = HKEY_LOCAL_MACHINE; + szRoot = szHLM; + } + else + { + root_key = HKEY_CURRENT_USER; + szRoot = szHCU; + } + HeapFree(GetProcessHeap(),0,all_users); + } + break; case 0: root_key = HKEY_CLASSES_ROOT; szRoot = szHCR; break;