Commit 1d453a1f authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Search network sources in addition to disk sources.

parent faf750f2
...@@ -686,7 +686,7 @@ static UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO ...@@ -686,7 +686,7 @@ static UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
/* FIXME: search NETWORK and URL sources as well */ /* FIXME: search URL sources as well */
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{ {
WCHAR source[MAX_PATH]; WCHAR source[MAX_PATH];
...@@ -694,8 +694,16 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -694,8 +694,16 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
WCHAR prompt[MAX_PATH]; WCHAR prompt[MAX_PATH];
DWORD volumesz, promptsz; DWORD volumesz, promptsz;
DWORD index, size, id; DWORD index, size, id;
WCHAR last_type[2];
UINT r; UINT r;
size = 2;
r = MsiSourceListGetInfoW(package->ProductCode, NULL,
package->Context, MSICODE_PRODUCT,
INSTALLPROPERTY_LASTUSEDTYPEW, last_type, &size);
if (r != ERROR_SUCCESS)
return r;
size = MAX_PATH; size = MAX_PATH;
r = MsiSourceListGetInfoW(package->ProductCode, NULL, r = MsiSourceListGetInfoW(package->ProductCode, NULL,
package->Context, MSICODE_PRODUCT, package->Context, MSICODE_PRODUCT,
...@@ -706,6 +714,27 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -706,6 +714,27 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
index = 0; index = 0;
volumesz = MAX_PATH; volumesz = MAX_PATH;
promptsz = MAX_PATH; promptsz = MAX_PATH;
if (last_type[0] == 'n')
{
while (MsiSourceListEnumSourcesW(package->ProductCode, NULL,
package->Context,
MSISOURCETYPE_NETWORK, index++,
volume, &volumesz) == ERROR_SUCCESS)
{
if (!strncmpiW(source, volume, strlenW(source)))
{
lstrcpyW(mi->source, source);
lstrcatW(mi->source, mi->cabinet);
TRACE("Found network source %s\n", debugstr_w(mi->source));
return ERROR_SUCCESS;
}
}
}
index = 0;
volumesz = MAX_PATH;
promptsz = MAX_PATH;
while (MsiSourceListEnumMediaDisksW(package->ProductCode, NULL, while (MsiSourceListEnumMediaDisksW(package->ProductCode, NULL,
package->Context, package->Context,
MSICODE_PRODUCT, index++, &id, MSICODE_PRODUCT, index++, &id,
...@@ -721,6 +750,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi) ...@@ -721,6 +750,7 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{ {
/* FIXME: what about SourceDir */ /* FIXME: what about SourceDir */
lstrcpyW(mi->source, source); lstrcpyW(mi->source, source);
TRACE("Found disk source %s\n", debugstr_w(mi->source));
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
} }
......
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