Commit 0713f098 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

Properly handle -1 as a registry key root.

parent 9a9f4cda
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment