From 98d9cec74cee88f2a680a9d57d0a191da980e5d4 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Wed, 18 May 2005 13:23:52 +0000 Subject: [PATCH] Correctly use short filenames from uncompressed file sources. Also default feature and component install states to ABSENT instead of UNKNOWN. --- dlls/msi/action.c | 21 +++++++++++++++------ dlls/msi/action.h | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index a243673b7e8..aa0dc8eaaa3 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -381,6 +381,13 @@ inline static void reduce_to_longfilename(WCHAR* filename) memmove(filename, p+1, (strlenW(p+1)+1)*sizeof(WCHAR)); } +inline static void reduce_to_shortfilename(WCHAR* filename) +{ + LPWSTR p = strchrW(filename,'|'); + if (p) + *p = 0; +} + WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index) { UINT rc; @@ -599,6 +606,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package) { HeapFree(GetProcessHeap(),0,package->files[i].File); HeapFree(GetProcessHeap(),0,package->files[i].FileName); + HeapFree(GetProcessHeap(),0,package->files[i].ShortName); HeapFree(GetProcessHeap(),0,package->files[i].Version); HeapFree(GetProcessHeap(),0,package->files[i].Language); HeapFree(GetProcessHeap(),0,package->files[i].SourcePath); @@ -1609,7 +1617,7 @@ static int load_component(MSIPACKAGE* package, MSIRECORD * row) sz = 96; MSI_RecordGetStringW(row,6,package->components[index].KeyPath,&sz); - package->components[index].Installed = INSTALLSTATE_UNKNOWN; + package->components[index].Installed = INSTALLSTATE_ABSENT; package->components[index].Action = INSTALLSTATE_UNKNOWN; package->components[index].ActionRequest = INSTALLSTATE_UNKNOWN; @@ -1676,7 +1684,7 @@ static void load_feature(MSIPACKAGE* package, MSIRECORD * row) package->features[index].Attributes= MSI_RecordGetInteger(row,8); - package->features[index].Installed = INSTALLSTATE_UNKNOWN; + package->features[index].Installed = INSTALLSTATE_ABSENT; package->features[index].Action = INSTALLSTATE_UNKNOWN; package->features[index].ActionRequest = INSTALLSTATE_UNKNOWN; @@ -1848,8 +1856,10 @@ static UINT load_file(MSIPACKAGE* package, MSIRECORD * row) HeapFree(GetProcessHeap(), 0, buffer); package->files[index].FileName = load_dynamic_stringW(row,3); - reduce_to_longfilename(package->files[index].FileName); + + package->files[index].ShortName = load_dynamic_stringW(row,3); + reduce_to_shortfilename(package->files[index].ShortName); package->files[index].FileSize = MSI_RecordGetInteger(row,4); package->files[index].Version = load_dynamic_stringW(row, 5); @@ -2981,8 +2991,7 @@ static UINT ready_media_for_file(MSIPACKAGE *package, WCHAR* path, if (file->Attributes & msidbFileAttributesNoncompressed) { - sz = MAX_PATH; - MSI_GetPropertyW(package, cszSourceDir, path, &sz); + TRACE("Uncompressed File, no media to ready.\n"); return ERROR_SUCCESS; } @@ -3154,7 +3163,7 @@ static UINT ACTION_InstallFiles(MSIPACKAGE *package) if (file->Attributes & msidbFileAttributesNoncompressed) { p = resolve_folder(package, comp->Directory, TRUE, FALSE, NULL); - file->SourcePath = build_directory_name(2, p, file->File); + file->SourcePath = build_directory_name(2, p, file->ShortName); HeapFree(GetProcessHeap(),0,p); } else diff --git a/dlls/msi/action.h b/dlls/msi/action.h index af718bee464..a88a07f5e15 100644 --- a/dlls/msi/action.h +++ b/dlls/msi/action.h @@ -82,6 +82,7 @@ typedef struct tagMSIFILE LPWSTR File; INT ComponentIndex; LPWSTR FileName; + LPWSTR ShortName; INT FileSize; LPWSTR Version; LPWSTR Language;