msi: more action.c cleanup
Aric Stewart
aric at codeweavers.com
Tue Jan 4 07:50:21 CST 2005
2 important fixes here.
1) properly deformat keys written to the registry
2) because directory mappings can change between the CostFinalize step
and the InstallFiles step we need to do a final resolution of the target
file name before installing.
-------------- next part --------------
--- /home/aric/wine/dlls/msi/action.c Tue Jan 4 07:35:15 2005
+++ ./action.c Mon Jan 3 13:34:04 2005
@@ -3177,6 +3220,20 @@
create_component_directory( package, file->ComponentIndex);
+ /* recalculate file pathes because things may have changed */
+
+ if (file->ComponentIndex >= 0)
+ comp = &package->components[file->ComponentIndex];
+
+ p = resolve_folder(package, comp->Directory, FALSE, FALSE, NULL);
+ if (file->TargetPath)
+ HeapFree(GetProcessHeap(),0,file->TargetPath);
+
+ file->TargetPath = build_directory_name(2, p, file->FileName);
+
+ len = strlenW(path_to_source) + strlenW(file->File) + 2;
+ file->SourcePath = (WCHAR*)HeapAlloc(GetProcessHeap(),0,len*
+ sizeof(WCHAR));
strcpyW(file->SourcePath, path_to_source);
strcatW(file->SourcePath, file->File);
@@ -3511,7 +3568,7 @@
LPSTR value_data = NULL;
HKEY root_key, hkey;
DWORD type,size;
- LPWSTR value, key, name, component;
+ LPWSTR value, key, name, component, deformated;
LPCWSTR szRoot;
INT component_index;
MSIRECORD * uirow;
@@ -3582,27 +3639,33 @@
goto next;
}
- size = strlenW(key) + strlenW(szRoot) + 1;
+ deformat_string(package, key , &deformated);
+ size = strlenW(deformated) + strlenW(szRoot) + 1;
uikey = HeapAlloc(GetProcessHeap(), 0, size*sizeof(WCHAR));
strcpyW(uikey,szRoot);
- strcatW(uikey,key);
- if (RegCreateKeyW( root_key, key, &hkey))
+ strcatW(uikey,deformated);
+
+ if (RegCreateKeyW( root_key, deformated, &hkey))
{
- ERR("Could not create key %s\n",debugstr_w(key));
+ ERR("Could not create key %s\n",debugstr_w(deformated));
msiobj_release(&row->hdr);
+ HeapFree(GetProcessHeap(),0,deformated);
goto next;
}
+ HeapFree(GetProcessHeap(),0,deformated);
value = load_dynamic_stringW(row,5);
value_data = parse_value(package, value, &type, &size);
+ deformat_string(package, name, &deformated);
+
if (value_data)
{
- TRACE("Setting value %s\n",debugstr_w(name));
- RegSetValueExW(hkey, name, 0, type, value_data, size);
+ TRACE("Setting value %s\n",debugstr_w(deformated));
+ RegSetValueExW(hkey, deformated, 0, type, value_data, size);
uirow = MSI_CreateRecord(3);
- MSI_RecordSetStringW(uirow,2,name);
+ MSI_RecordSetStringW(uirow,2,deformated);
MSI_RecordSetStringW(uirow,1,uikey);
if (type == REG_SZ)
@@ -3616,6 +3679,7 @@
HeapFree(GetProcessHeap(),0,value_data);
}
HeapFree(GetProcessHeap(),0,value);
+ HeapFree(GetProcessHeap(),0,deformated);
msiobj_release(&row->hdr);
RegCloseKey(hkey);
More information about the wine-patches
mailing list