From b012c3366ce2debdb4e278524583336fcae2f571 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Sat, 5 Jan 2008 13:47:48 -0700 Subject: [PATCH] msi: Directly download mi->source now that SourceDir points to the URL. --- dlls/msi/files.c | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/dlls/msi/files.c b/dlls/msi/files.c index 7e73b75d19c..4be78b395b4 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -500,42 +500,6 @@ static void free_media_info( struct media_info *mi ) msi_free( mi ); } -static UINT download_remote_cabinet(MSIPACKAGE *package, struct media_info *mi) -{ - WCHAR temppath[MAX_PATH]; - LPWSTR src, ptr; - LPCWSTR cab; - - src = strdupW(package->BaseURL); - if (!src) - return ERROR_OUTOFMEMORY; - - ptr = strrchrW(src, '/'); - if (!ptr) - { - msi_free(src); - return ERROR_FUNCTION_FAILED; - } - - *(ptr + 1) = '\0'; - ptr = strrchrW(mi->source, '\\'); - if (!ptr) - ptr = mi->source; - - src = msi_realloc(src, (lstrlenW(src) + lstrlenW(ptr)) * sizeof(WCHAR)); - if (!src) - return ERROR_OUTOFMEMORY; - - lstrcatW(src, ptr + 1); - - temppath[0] = '\0'; - cab = msi_download_file(src, temppath); - lstrcpyW(mi->source, cab); - - msi_free(src); - return ERROR_SUCCESS; -} - static UINT load_media_info(MSIPACKAGE *package, MSIFILE *file, struct media_info *mi) { MSIRECORD *row; @@ -625,7 +589,11 @@ static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *m GetFileAttributesW(mi->source) == INVALID_FILE_ATTRIBUTES && package->BaseURL && UrlIsW(package->BaseURL, URLIS_URL)) { - return download_remote_cabinet(package, mi); + WCHAR temppath[MAX_PATH]; + + msi_download_file(mi->source, temppath); + lstrcpyW(mi->source, temppath); + return ERROR_SUCCESS; } /* check volume matches, change media if not */