Commit 77d259f4 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Search the last used source if the cabinet to extract cannot be found.

parent c1940e39
......@@ -577,7 +577,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
}
/* FIXME: search NETWORK and URL sources as well */
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{
WCHAR source[MAX_PATH];
WCHAR volume[MAX_PATH];
......@@ -586,6 +586,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
DWORD index, size, id;
UINT r;
size = MAX_PATH;
r = MsiSourceListGetInfoW(package->ProductCode, NULL,
package->Context, MSICODE_PRODUCT,
INSTALLPROPERTY_LASTUSEDSOURCEW, source, &size);
......
......@@ -1163,6 +1163,16 @@ UINT msi_extract_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR destdir)
if (r != ERROR_SUCCESS)
goto done;
if (GetFileAttributesW(mi->source) == INVALID_FILE_ATTRIBUTES)
{
r = find_published_source(package, mi);
if (r != ERROR_SUCCESS)
{
ERR("Cabinet not found: %s\n", debugstr_w(mi->source));
return ERROR_INSTALL_FAILURE;
}
}
data.package = package;
data.mi = mi;
data.file = file;
......
......@@ -908,6 +908,7 @@ extern UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO
extern void msi_free_media_info(MSIMEDIAINFO *mi);
extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, PFNFDINOTIFY notify, LPVOID data);
extern UINT msi_extract_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR destdir);
extern UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi);
/* control event stuff */
extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment