msi: Directly download mi->source now that SourceDir points to the URL.

This commit is contained in:
James Hawkins 2008-01-05 13:47:48 -07:00 committed by Alexandre Julliard
parent 186487663a
commit b012c3366c
1 changed files with 5 additions and 37 deletions

View File

@ -500,42 +500,6 @@ static void free_media_info( struct media_info *mi )
msi_free( 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) static UINT load_media_info(MSIPACKAGE *package, MSIFILE *file, struct media_info *mi)
{ {
MSIRECORD *row; MSIRECORD *row;
@ -625,7 +589,11 @@ static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *m
GetFileAttributesW(mi->source) == INVALID_FILE_ATTRIBUTES && GetFileAttributesW(mi->source) == INVALID_FILE_ATTRIBUTES &&
package->BaseURL && UrlIsW(package->BaseURL, URLIS_URL)) 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 */ /* check volume matches, change media if not */