James Hawkins : msi: Directly download mi-> source now that SourceDir points to the URL.
Alexandre Julliard
julliard at winehq.org
Mon Jan 7 08:39:10 CST 2008
Module: wine
Branch: master
Commit: b012c3366ce2debdb4e278524583336fcae2f571
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b012c3366ce2debdb4e278524583336fcae2f571
Author: James Hawkins <truiken at gmail.com>
Date: Sat Jan 5 13:47:48 2008 -0700
msi: Directly download mi->source now that SourceDir points to the URL.
---
dlls/msi/files.c | 42 +++++-------------------------------------
1 files changed, 5 insertions(+), 37 deletions(-)
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 7e73b75..4be78b3 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 */
More information about the wine-cvs
mailing list